Changing value of $@

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • labzilla

    Changing value of $@

    I want to modify the value of $@ so that
    if( $@ ) becomes a true statement.
    Sorry if this is a newbie question.
  • Jim Gibson

    #2
    Re: Changing value of $@

    In article <pan.2005.07.21 .17.46.52.73414 8@where.org>, labzilla
    <who@where.or g> wrote:
    [color=blue]
    > I want to modify the value of $@ so that
    > if( $@ ) becomes a true statement.
    > Sorry if this is a newbie question.[/color]

    $@ = 1;

    .... but why do you want to do that? $@ contains the status of the last
    eval operation. A program should generally not be setting the value of
    a system-supplied variable.

    FYI: this newsgroup is defunct. Try comp.lang.perl. misc in the future.

    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

    Comment

    • Randal L. Schwartz

      #3
      Re: Changing value of $@

      *** post for FREE via your newsreader at post.newsfeed.c om ***
      [color=blue][color=green][color=darkred]
      >>>>> "labzilla" == labzilla <who@where.or g> writes:[/color][/color][/color]

      labzilla> I want to modify the value of $@ so that
      labzilla> if( $@ ) becomes a true statement.
      labzilla> Sorry if this is a newbie question.

      And $@ = "foo" didn't do it?

      And, my standard disclaimer:

      If you can see this message, you are reading a group that is not
      officially carried, and therefore doesn't get the propogation or
      readership that the official comp.lang.perl. misc group gets.

      What this means TO YOU is that your question won't be answered
      to the same expert level that an official group will get. You'll
      get answers that are wrong (and not noticed to be wrong), or no
      answer at all.

      STOP POSTING HERE. POST TO COMP.LANG.PERL. MISC

      And send email to your news server administrator to PLEASE DELETE THIS
      GROUP.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@stonehe nge.com> <URL:http://www.stonehenge. com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.St onehenge.com for onsite and open-enrollment Perl training!


      -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
      http://www.newsfeed.com - The #1 Newsgroup Service in the World!
      -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

      Comment

      • Gerard Wassink

        #4
        Re: Changing value of $@

        Op Thu, 21 Jul 2005 11:41:21 -0700 schreef Jim Gibson:
        [color=blue]
        > In article <pan.2005.07.21 .17.46.52.73414 8@where.org>, labzilla
        > <who@where.or g> wrote:
        >[color=green]
        >> I want to modify the value of $@ so that
        >> if( $@ ) becomes a true statement.
        >> Sorry if this is a newbie question.[/color]
        >
        > $@ = 1;
        >
        > ... but why do you want to do that? $@ contains the status of the last
        > eval operation. A program should generally not be setting the value of
        > a system-supplied variable.
        >
        > FYI: this newsgroup is defunct. Try comp.lang.perl. misc in the future.
        >
        > ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
        > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
        > ----= East and West-Coast Server Farms - Total Privacy via Encryption =----[/color]

        Or, just to be sure:
        $@ = (1==1);

        PapaBear

        --
        Ain't no place like 127.0.0.1

        mail: echo cncnorre@svygre arg.ay | perl -pe 'y/a-z/n-za-m/'
        Christians are the evidence that God has humor.

        Comment

        Working...