Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Splitting blunder

by perlplexer (Hermit)
on Apr 08, 2002 at 18:18 UTC ( #157506=note: print w/replies, xml ) Need Help??


in reply to Splitting blunder

Not sure how you can get blanks for all of them...
The first two elements will always be blank since Server name is always preceded by '\\'...
Here is what you could do to avoid that
# example 1 @tmp = split /\\/, substr($string, 2); print join(',', @tmp), "\n"; # example 2 $string =~ s/^\\+//; @tmp = split /\\/, $string; print join(',', @tmp), "\n"; # example 3 @tmp = split /\\+/, $string; shift @tmp; print join(',', @tmp), "\n";

--perlplexer

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2023-12-07 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?