Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Can't do dereference when running code inserted inside regex

by AlexP (Pilgrim)
on Jan 16, 2022 at 07:27 UTC ( [id://11140493]=note: print w/replies, xml ) Need Help??


in reply to Can't do dereference when running code inserted inside regex

I see error in your code:

my @dat=[qw(foo bar)];

You are trying to assign @var the reference to an array (not an array). You should:

my @dat=qw(foo bar);

Please, don't forget to use warnings pragma. It helps with these kinds of mistakes.

Replies are listed 'Best First'.
Re^2: Can't do dereference when running code inserted inside regex
by LanX (Saint) on Jan 16, 2022 at 10:42 UTC
    Yes it looks strange, but that's what he wanted. Look at the dereference inside the loop.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found