Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Using expressions in arrays for pattern matching

by yosefm (Friar)
on Dec 01, 2003 at 22:29 UTC ( #311425=note: print w/ replies, xml ) Need Help??


in reply to Re: Using expressions in arrays for pattern matching
in thread Using expressions in arrays for pattern matching

Nice, but I have one nitpick:

my $thisout = substr($i, 0, index($i, ".")) . ".txt"
What about names like "my.file.rpt" (pretty common style on *nix)?

Since we are already through with $i (let's call it $file from now on), we can do:

$file =~ s/\.rpt$/.txt/i; #case insensitive open OUTPUT, ">$file";


Comment on Re: Re: Using expressions in arrays for pattern matching
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Re: Using expressions in arrays for pattern matching
by melora (Scribe) on Dec 02, 2003 at 00:22 UTC
    I like that better, thanks for the nitpick!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-28 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls