Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Matching @ in string

by dwu (Monk)
on Nov 22, 2007 at 13:28 UTC ( #652366=note: print w/replies, xml ) Need Help??


in reply to Re: Matching @ in string
in thread Matching @ in string

*cough*

$ perl -e 'if (\'h@t\' =~ /(\@)/ ) { print $1 }' -bash: syntax error near unexpected token `('

Not sure why - does escaping the single quote not work?

Replies are listed 'Best First'.
Re^3: Matching @ in string
by lima1 (Curate) on Nov 22, 2007 at 13:34 UTC
    Because the bash does not change anything in the -e ' .. ' string. And
    if (\'h@t\' =~ /(\@)/ ) {
    is no valid perl.
    And the -e string ends after if (\.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2021-04-18 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?