| | |
file name with "interval"
![]() |
•
•
Join Date: Sep 2008
Posts: 8
Reputation:
Solved Threads: 0
Hi !
My script don't understand file name with "interval",
help me with it problem !!!!
Vika
My script don't understand file name with "interval",
help me with it problem !!!!
Perl Syntax (Toggle Plain Text)
use Cwd; $dir = cwd(); $vardas=$dir; while($vardas=~/(.*\/)+(.*)/){ $vardas="$2_source"; } $newfile = "$dir/$vardas.tex"; FILE: foreach $file (<@ARGV>) { if ($file eq $newfile) {next FILE}; if (-e "$dir/$vardas.tex"){ print "File exist\n";} else{ print "Rename: "."$file\n"; rename ($file, $newfile) || die "Can't rename.\n";} }
Vika
0
#2 Dec 8th, 2009
I don't understand this script at all... you are doing a number of things that make little sense. For example:
Where is the variable $2_source coming from? You're also resetting the variable $vardas when inside your WHILE loop. That's never going to work.
Perl Syntax (Toggle Plain Text)
while($vardas=~/(.*\/)+(.*)/){ $vardas="$2_source"; }
Where is the variable $2_source coming from? You're also resetting the variable $vardas when inside your WHILE loop. That's never going to work.
And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is.
Larry Wall
Larry Wall
![]() |
Similar Threads
- COMPILE A "STANDALONE" .EXE FILE (Visual Basic 4 / 5 / 6)
- google "keyword" question (Search Engine Optimization)
- Sorry, another "collected.5.l" log file (Viruses, Spyware and other Nasties)
- inputing system("date /t") and system("time /t") into a file (C++)
- "Catastrophic file transfer error" ?? (Windows NT / 2000 / XP)
Other Threads in the Perl Forum
- Previous Thread: Search and Replace Script
- Next Thread: regular expression
Views: 760 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Perl





