Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: What is wrong here (Replacing Strin pieces)

by AnomalousMonk (Chancellor)
on Jul 16, 2013 at 16:23 UTC ( #1044631=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $string =~ s/\A(-+)|(-+)$/("?" x length $1).("?" x length $2)/eg;
    
  2. or download this
    >perl -wMstrict -le
    "my $s = '---------xxxxxxxxxxxxxxx------yyyyyyyyyyyyyy--------';
    ...
    Use of uninitialized value $2 in repeat (x) at -e line 1.
    Use of uninitialized value $1 in repeat (x) at -e line 1.
    '?????????xxxxxxxxxxxxxxx------yyyyyyyyyyyyyy????????'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044631]
help
Chatterbox?
NodeReaper practices with his stiletto

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-06-18 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (107 votes). Check out past polls.

    Notices?