Re: easiest way to set $1 $2 $3...

Discussion in 'Perl Misc' started by Rainer Weikusat, Jul 18, 2012.

  1. writes:
    > In /bin/sh it merely takes a
    > $ set a b c
    > to set $1 $2 $3.
    >
    > So what is the easiest way to do the same in perl?
    >
    > Yes in perl they are related to regexps. No don't ask me why I want to
    > set them, Just pretend I need to use them on the next line and want to
    > try some different values.


    Trivially, you don't "need to use them" except if capturing parts of a
    string matched by some regexp. So, why don't you just use a suitable
    string as input?
     
    Rainer Weikusat, Jul 18, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gianni Galore
    Replies:
    0
    Views:
    354
    Gianni Galore
    Jan 12, 2011
  2. enspired

    easiest way to set future date

    enspired, Oct 30, 2005, in forum: Ruby
    Replies:
    1
    Views:
    100
    Gene Tani
    Oct 30, 2005
  3. RichardOnRails
    Replies:
    4
    Views:
    137
    RichardOnRails
    Jan 23, 2011
  4. Wolf Behrenhoff

    Re: easiest way to set $1 $2 $3...

    Wolf Behrenhoff, Jul 18, 2012, in forum: Perl Misc
    Replies:
    0
    Views:
    441
    Wolf Behrenhoff
    Jul 18, 2012
  5. Jürgen Exner

    Re: easiest way to set $1 $2 $3...

    Jürgen Exner, Jul 18, 2012, in forum: Perl Misc
    Replies:
    1
    Views:
    524
    Tim McDaniel
    Jul 18, 2012
Loading...

Share This Page