Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Replace $a with $b if $a ne $b

by Roy Johnson (Monsignor)
on May 06, 2005 at 19:27 UTC ( [id://454788]=note: print w/replies, xml ) Need Help??


in reply to Re: Replace $a with $b if $a ne $b
in thread Replace $a with $b if $a ne $b

Once you've cleared $dir, it's useless to compare $currentdir to it. Maybe you want something like:
my $printed_dir = ''; foreach $file (@filelist) { my ($dir, $name) = split '/', $file; printf("%s %s\n", ($dir eq $printed_dir ? '' : $dir), $name); $printed_dir = $dir; }

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found