Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: search for '\' in perl

by ricDeez (Scribe)
on Dec 12, 2011 at 15:45 UTC ( [id://943107]=note: print w/replies, xml ) Need Help??


in reply to search for '\' in perl

This is probably what you want, taking into account the comments by the other monks:

use strict; use warnings; use 5.012; my @list = ("C:\\username\\Sources"); for (@list) { say "array char = $_"; while ($_ =~ m/\\/g) { say "found a '$&'"; # holds the portion of the string that mat +ched } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-03-19 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found