Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Assign Contains RegEx WTF??

by Anonymous Monk
on May 20, 2009 at 14:22 UTC ( [id://765237]=note: print w/replies, xml ) Need Help??


in reply to Re: Assign Contains RegEx WTF??
in thread Assign Contains RegEx WTF??

Thank you wise monk(s)! My confusion has blossomed into amusement. The original "programmer" was only good at "pasting".

Original code:
$fname = $TMP_DIR . "\\" . $tnum . ".tmp"; ($bname = $fname) =~ s#.*\\##s;
New code: (terseness removed)
$bname = $tnum . ".tmp"; $fname = $TMP_DIR . "\\" . $bname;

Replies are listed 'Best First'.
Re^3: Assign Contains RegEx WTF??
by kennethk (Abbot) on May 21, 2009 at 14:26 UTC
    If you are just modifying paths, you may consider using the File::Spec module. May very well be overkill for your app, though.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://765237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found