Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Deparse isn't as reliable as I thought

by harleypig (Monk)
on Mar 03, 2006 at 21:47 UTC ( [id://534376]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    $string = '   abc   def   ';
    ...
    print '2: ' . ( join '|', @array1 ) . "\n";
    
    print '3: ' . ( join '|', @array2 ) . "\n";
    
  2. or download this
    BEGIN { $^W = 1; }
    $string = '   abc   def   ';
    @array1 = split(?\s+?, $string, 0);
    @array2 = split(?\s+?, $string, 0);
    print '2: ' . join('|', @array1) . "\n";
    print '3: ' . join('|', @array2) . "\n";
    
  3. or download this
    2: abc|def
    3: |abc|def
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://534376]
Approved by Corion
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found