Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Global symbol "@blah" requires explicit package name

Expand Messages
  • mandwahlin
    ... your ... have ... in ... First script working yay! Did I say thanks? *dances around room with delight
    Message 1 of 5 , Aug 5, 2003
    View Source
    • 0 Attachment
      --- In perl-beginner@yahoogroups.com, "mandwahlin" <mandwahlin@m...>
      wrote:
      > --- In perl-beginner@yahoogroups.com, "Damien Carbery"
      > <daymobrew@y...> wrote:
      > > --- In perl-beginner@yahoogroups.com, "Carlos Diaz" <perl@f...>
      > wrote:
      > > > Your answer is "double quote interpolation"... it is seeing
      your
      > funny
      > > > caracters $... and @... as variables not declared under strict
      > > pragma. You
      > > > must scape those caracters when using double quotes for literal
      > > > interpretation.
      > > >
      > > > CD
      > > >
      > > An even easier solution is to use single quotes. Then you won't
      have
      > > to escape the '$' and '@' characters.
      > >
      > > BTW, you 'escape' special characters by putting a backslash, '\',
      in
      > > front of them.
      > Hi Damien and Carlos
      >
      > Thanks for your help, I figured it was something to do with the @
      > characters but couldn't find an answer on the net, so cheers
      >
      > my code now reads
      >
      > #!/bin/perl -w
      > use strict;
      > use CGI;
      > use CGI::Carp qw(fatalsToBrowser);
      >
      > # Variable declaration
      > my ($form, $txt,$sur,$mail,$file,$mailprog,$from,$reply);
      >
      >
      > $form = new CGI;
      > $txt = $form->param('name');
      > $sur = $form->param('surname');
      > $mail = $form->param('email');
      > $file = "data.txt";
      > $mailprog = "/bin/easymail -t";
      > $from = "webmaster\@...";
      > $reply = "reply\@...";
      >
      > open (FILE, ">>data.txt");
      > print FILE $txt."\t".$sur."\t".$mail."\n";
      > close(FILE);
      >
      > open( EZMAIL, "|$mailprog" );
      > print EZMAIL "From: $from\nTo: $mail\n";
      > print EZMAIL "Subject: This is a test message\n";
      > print EZMAIL "X-Priority: 1\n";
      > print EZMAIL "Reply-To: $reply\n";
      > print EZMAIL "Organization: Sly Arts.\n";
      > print EZMAIL "\nYo Tobe and Pete, thanks 4 testing:).\n";
      > print EZMAIL "\n.\n";
      > close( EZMAIL );

      First script working yay! Did I say thanks? *dances around room with
      delight
    Your message has been successfully submitted and would be delivered to recipients shortly.