Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: search, replace and backrefrences

by demerphq (Chancellor)
on Sep 30, 2002 at 15:27 UTC ( #201742=note: print w/replies, xml ) Need Help??


in reply to search, replace and backrefrences

Well, im not real sure that $1_0_0_ isnt being treated as such.

But a useful trick in this situation and others is to use the form ${varname} to delimit the the identifier. Ie

my $foo="Groove"; print "$food"; # Error $food is not a declared indentifier. print "${foo}d"; # same as $foo."d";
So the rhs of the first and second could be ${1}0_0$2 and ${1}_0_0_$2 respectively.

--- demerphq
my friends call me, usually because I'm late....

Replies are listed 'Best First'.
Re: Re: search, replace and backrefrences
by rir (Vicar) on Sep 30, 2002 at 16:52 UTC
    Well, im not real sure that $1_0_0_ isnt being treated as such.

    Variable names that start with a digit may only have
    more digits in the name.

    This seems a murky area. my $99; throws an error.

    This post has little to do with the original question.

      Even with the number formatting semantics where 1_000_000 == 1000000?

        Even with the number formatting semantics where 1_000_000 == 1000000?

        Yes this use of underscores is only for numeric literals.

      Variable names that start with a digit may only have more digits in the name.

      Cool. I didnt know that. What perldoc is it in?

      This seems a murky area. my $99; throws an error.

      Well, i agree its weird, but its not that murky. All of the ^\d+$ variables are global only and cannot be my()ed (and all of the scalars are read only).

      --- demerphq
      my friends call me, usually because I'm late....

        I was about to say murky, but unimportant but bit my tongue
        as everything is important to someone.

        It seems unclear what behavior is intended, i.e. murky.
        Why shouldn't I be able to my $99;?   I haven't seen anything to
        suggest it is illegal. Or why is $123456 read-only?

        Is this documented somewhere? Point me at it.

        I'm pretty sure I got that from the Camel book.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-01-23 13:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?