Perl portability

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

    Perl portability

    I wrote a perl script and tested it on windows and it works fine. I then
    moved it onto a solaris machine and now it says that there is a syntax
    error with the following line of code:

    $user1 = "User name: ".$rec1[0];

    the line of code just before that is:

    @rec1 = split(/@/, $autotrack[$records]);


    any ideas?
    I can't see that there is anything uniquely windows about that. There is
    a difference in the version of perl in that on the windows box I have
    active state v5.8.6 and the solaris box has solaris perl 5.00.3 or
    something like that.
  • Jim Gibson

    #2
    Re: Perl portability

    In article <dga257$503$1@n wrdmz02.dmz.ncs .ea.ibs-infra.bt.com>, Hendry
    Taylor <hendry.taylor@ btinternet.com> wrote:
    [color=blue]
    > I wrote a perl script and tested it on windows and it works fine. I then
    > moved it onto a solaris machine and now it says that there is a syntax
    > error with the following line of code:
    >
    > $user1 = "User name: ".$rec1[0];
    >
    > the line of code just before that is:
    >
    > @rec1 = split(/@/, $autotrack[$records]);
    >
    >
    > any ideas?
    > I can't see that there is anything uniquely windows about that. There is
    > a difference in the version of perl in that on the windows box I have
    > active state v5.8.6 and the solaris box has solaris perl 5.00.3 or
    > something like that.[/color]

    I see nothing wrong with those two lines, either. They compile fine on
    my non-windows machine also running 5.8.6. It probably has more to do
    with the very old version of Perl running on your Solaris system, but
    the line in question would seem to be acceptable Perl 4, so I have no
    idea what the problem is.

    Since this newsgroup is defunct, you have a much higher probability of
    getting your problem solved if you pose your question to
    comp.lang.perl. misc. It is best to post a complete, short program that
    illustrates your problem.

    What does 'perl -v' produce on your Solaris system?

    Posted Via Usenet.com Premium Usenet Newsgroup Services
    ----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    ----------------------------------------------------------
    Best Usenet Service Providers 2025 ranked by Newsgroup Access Newsservers, Usenet Search, Features & Free Trial. Add VPN for privacy.

    Comment

    • axel@white-eagle.invalid.uk

      #3
      Re: Perl portability

      In comp.lang.perl. misc Hendry Taylor <hendry.taylor@ btinternet.com> wrote:

      [On something Perlish]

      But the subject line got me thinking... Perl portability... why
      not Perl potability in the shape of a Perl beer mug? I have a vi
      mug, so it is clearly achievable.

      Axel

      Comment

      • Darren Dunham

        #4
        Re: Perl portability

        In comp.lang.perl. misc Hendry Taylor <hendry.taylor@ btinternet.com> wrote:[color=blue]
        > I wrote a perl script and tested it on windows and it works fine. I then
        > moved it onto a solaris machine and now it says that there is a syntax
        > error with the following line of code:[/color]
        [color=blue]
        > $user1 = "User name: ".$rec1[0];[/color]
        [color=blue]
        > the line of code just before that is:[/color]
        [color=blue]
        > @rec1 = split(/@/, $autotrack[$records]);[/color]

        Is that code within a BLOCK? What is the exact error string that you're
        getting?

        --
        Darren Dunham ddunham@taos.co m
        Senior Technical Consultant TAOS http://www.taos.com/
        Got some Dr Pepper? San Francisco, CA bay area
        < This line left intentionally blank to confuse you. >

        Comment

        • Hendry Taylor

          #5
          Re: Perl portability

          Well here is the entire code it is rather long. It just says syntax
          error on line 55 near $user1


          #!/usr/bin/perl
          use Tie::File;
          use Switch;
          sub trimwhitespace( $);
          sub nslookup();
          $debug = 0;
          chdir("/usr/local/home/autosys/seos_autotrack" );
          $auditrecords = 0;
          $n = 0;
          $srecords = 0;
          $arecords = 0;
          $index = 0;
          $totalmatched = 0;
          $totalunmatched = 0;
          my @monthnames = (qw(dummy Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec));
          open FILEREAD, "<seos_autotrac k_day";
          $runday = <FILEREAD>;
          close FILEREAD;
          $logfilename = "autotrack-seos-compare".$runda y.".log";
          use Fcntl 'O_RDWR', 'O_CREAT';
          my $o = tie @logfile, 'Tie::File', $logfilename, mode => O_RDWR |
          O_CREAT, dw_size => 512;
          $logrecords = @logfile;
          if ($logrecords > 0) {splice @logfile, 0, $logrecords;}
          $o->STORE($n, "Debug mode set to: ".$debug);
          open FILEREAD, "<seos_autotrac k_date";
          $rundate = <FILEREAD>;
          close FILEREAD;
          tie @servers, 'Tie::File', 'servers' || die "Can't open: $!\n";
          foreach $server (@servers)
          {
          $iplist = nslookup($serve r, 'Address');
          $serverlist{$ip list} = sprintf "%s",$serve r;
          $serverlist1{$s erver} = sprintf "%s",$iplis t;
          print FILEWRITE "$server $iplist\n";
          }
          untie @servers;
          local $now = time;
          ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
          localtime(time) ;
          $o->STORE(++$n, "Start time = ".$hour.":".$mi n.":".$sec);
          @files = <autotrack_*-$runday.out>;
          foreach $arrayfiles(@fi les) #foreach autotrack file
          {
          $records = 1;
          $line = 1;
          tie @autotrack, 'Tie::File', $arrayfiles || die "Can't open: $!\n";
          $o->STORE(++$n, "Processing autotrack file: ".$arrayfil es);
          foreach $item (@autotrack) #foreach autotrack record
          {
          switch ($line)
          {
          case 1
          {
          $rec1 = $autotrack[$records];
          @rec1 = split(/@/, $autotrack[$records]);
          $user1 = "User name: ".$rec1[0];
          $user = $rec1[0];
          $terminal = $rec1[1];
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "user = ".$rec1[0]);
          $o->STORE(++$n, "terminal = ".$rec1[1]);
          }
          ++$line;
          } #Close case 1
          case 2
          {
          @datetime = split(/ /, $autotrack[$records]);
          @rec21 = split(/\//, $datetime[0]);
          $edate = sprintf "$rec21[0] $monthnames[$rec21[1]] $rec21[2]";
          $edate1 = sprintf "Date: $rec21[0] $monthnames[$rec21[1]] $rec21[2]";
          @rec22 = split(/:/, $datetime[1]);
          $etime = sprintf "$rec22[0]:$rec22[1]";
          $etime1 = sprintf "Time: $rec22[0]:$rec22[1]";
          $edatetime = sprintf "$edate $etime";
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "date = ".$edate);
          $o->STORE(++$n, "time = ".$etime);
          $o->STORE(++$n, "date time = ".$edatetim e);
          }
          ++$line;
          } #Close case 2
          case 3
          {
          $event = $autotrack[$records];
          @rec3 = split(/ /, $event);
          $command = trimwhitespace( $rec3[0]);
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "event = ".$event);
          $o->STORE(++$n, "command = ".$command) ;
          }
          ++$line;
          } #Close case 3
          case 4 { ++$line }
          case 5
          {
          @rec5 = split(/:/, $autotrack[$records]);
          $rec5[0] = trimwhitespace( $rec5[0]);
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, $rec5[0]." = ".$rec5[1]);
          }
          ++$line;
          } #Close case 5
          case 6
          {
          @rec6 = split(/:/, $autotrack[$records]);
          $rec6[0] = trimwhitespace( $rec6[0]);
          $rec6[1] =~ s/^\s+//;
          @rec61 = split(/ /, $rec6[1]);
          foreach $array_element( @rec61)
          {
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "rec61: ".$rec61[$index]);
          }
          $rec61[$index] =~ s/\"//g;
          switch ($rec61[0])
          {
          case "sendevent"
          {
          switch ($rec61[2])
          {
          case "SET_GLOBAL "
          {
          $class1 = "Class: as-gvar";
          $class = "as-gvar";
          }
          case "FORCE_STARTJOB "
          {
          $class1 = "Class: as-job";
          $class = "as-job";
          }
          else
          {
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "unmatched sendevent type");
          }
          }
          }
          }
          else
          {
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "unmatched command");
          }
          }
          }
          ++$index;
          } #Close foreach specific array_element
          @rec62 = split(/\=/, $rec61[4]);
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, $rec6[0]." = ".$rec6[1]);
          $o->STORE(++$n, "rec62 = ".$rec62[0].", ".$rec62[1]);
          }
          $index = 0;
          ++$line;
          } #Close case 6
          else
          {
          if ($autotrack[$records] eq
          ":::::::::::::: ::::::::::::::: ::::::::::::::: ::::::::::::::: ::::::::::::::: :::::")
          {
          ++$auditrecords ;
          $search = sprintf
          "$edatetime.*$c lass.*$command. *$terminal|$ser verlist1[$terminal]";
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "Search value = ".$search);
          $o->STORE(++$n, "Class = ".$class1." , resource = ".$rec62[0].", user
          = ".$user1.", terminal = ".$terminal 1.", date = ".$edate1." , time =
          ".$etime1);
          }
          $match = 0;
          $array_files = "seosauditsucce ss_".$terminal. "_".$runday.".o ut";
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "connecting to file: ".$array_files) ;
          }
          tie @seosaudit, 'Tie::File', $array_files || die "Can't open: $!\n";
          foreach $array_element( @seosaudit)
          {
          ++$srecords;
          if ($array_element =~ m/Total Records Displayed.*/)
          {
          next;
          } #Close if
          if($array_eleme nt =~ m/($search)/)
          {
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "Class = ".$class1." , resource = ".$rec62[1].",
          user = ".$user1.", terminal = Terminal: ".$terminal .", date =
          ".$edate1." , time = ".$etime1);
          }
          if ($match >= 6)
          {
          $found = 1;
          $match = 0;
          next;
          }
          } #Close if
          if ($array_element =~ m/($class1)/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~ m/Resource: ($rec62[0])\..*/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~ m/($user1)/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~
          m/Terminal\:.*($t erminal|$server list1[$terminal])/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~ m/Program\:.*($co mmand)/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~ m/($edate1)/)
          {
          ++$match;
          } #close if array_element
          if ($array_element =~ m/($etime1)/)
          {
          ++$match;
          } #close if array_element
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, "SeosAudit record = ".$array_elemen t);
          }
          } #Close foreach
          if ($found == 1)
          {
          $o->STORE(++$n, "Record found in the seosdb audit file: ".$array_files) ;
          $found = 0;
          $match = 0;
          ++$totalmatched ;
          }
          elsif ($found == 0)
          {
          $o->STORE(++$n, "Record not found in the seosdb audit file!!!!
          ".$array_files) ;
          $o->STORE(++$n, "Autotrack Data:\n\t".$cla ss1.",\n\tResou rce:
          ".$rec62[0].",\n\t".$user1 .",\n\t".$termi nal1.",\n\tProg ram:
          ".$command.",\n \t".$edate1.",\ n\t".$etime1);
          $found = 0;
          $match = 0;
          ++$totalunmatch ed;
          }
          $line = 1;
          untie @seosaudit;
          } #Close if Last record of autotrack
          elsif ($autotrack[$records] eq "")
          {
          $o->STORE(++$n, "\n\n");
          } #Close else if
          else
          {
          @recdef = split(/:/, $autotrack[$records]);
          $recdef[0] = trimwhitespace( $recdef[0]);
          if ($debug == 1) #Create output if debug is on
          {
          $o->STORE(++$n, $recdef[0]." = ".$recdef[1]);
          }
          ++$line;
          } #Close else of last record if
          } #Close of switch else for autotrack
          } #Close of switch for autotrack

          ++$records;
          # if ($records == 50)
          # {
          # $o->STORE(++$n, "Total unique Audit records read = ".$auditrecords );
          # $o->STORE(++$n, "Total records matched = ".$totalmatched );
          # $o->STORE(++$n, "Total records not matched = ".$totalunmatch ed);
          # $now = time - $now;
          # ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
          localtime(time) ;
          # $o->STORE(++$n, "End time = ".$hour.":".$mi n."$:".$sec);
          # $o->STORE(++$n, "It took ".int($now / 3600).":".int(( $now % 3600) /
          60).":".int($no w % 60). "to process ".$arecords ." Autotrack records and
          ".$srecords ." Seoasdb records");
          # exit;
          # }
          }
          untie @seosaudit;
          untie @autotrack;
          $arecords = $arecords + $records;
          }
          $o->STORE(++$n, "Total unique Audit records read = ".$auditrecords );
          $o->STORE(++$n, "Total records matched = ".$totalmatched );
          $o->STORE(++$n, "Total records not matched = ".$totalunmatch ed);
          $now = time - $now;
          ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
          localtime(time) ;
          $o->STORE(++$n, "End time = ".$hour.":".$mi n.":".$sec);
          $o->STORE(++$n, "It took ".int($now / 3600).":".int(( $now % 3600) /
          60).":".int($no w % 60)." to process ".$arecords ." autotrack records and
          ".$srecords ." Seosaudit records");
          untie @logfile;
          # Function to remove whitespace from the begining and the end of a string.
          sub trimwhitespace( $)
          {
          my $string = shift;
          $string =~ s/^\s+//;
          $string =~ s/\s+//;
          return $string;
          }

          sub nslookup() {
          my ($host, $word) = @_;
          open(NSLOOKUP, "nslookup $host 2>&1 |") || die "nslookup error";
          while (<NSLOOKUP>) {
          if (/Name:.*$host\.e ur\.nsroot\.net/) {
          $found = 1;
          }
          last if (/$word/ & $found == 1);
          if (/\*\*\*/) {
          print "nslookup says: $_";
          die "*** nslookup error";
          }
          }
          close(NSLOOKUP) ;
          s/$word:\s*//;
          chomp;
          $found = 0;
          return $_;
          }


          Darren Dunham wrote:[color=blue]
          > In comp.lang.perl. misc Hendry Taylor <hendry.taylor@ btinternet.com> wrote:
          >[color=green]
          >>I wrote a perl script and tested it on windows and it works fine. I then
          >>moved it onto a solaris machine and now it says that there is a syntax
          >>error with the following line of code:[/color]
          >
          >[color=green]
          >>$user1 = "User name: ".$rec1[0];[/color]
          >
          >[color=green]
          >>the line of code just before that is:[/color]
          >
          >[color=green]
          >>@rec1 = split(/@/, $autotrack[$records]);[/color]
          >
          >
          > Is that code within a BLOCK? What is the exact error string that you're
          > getting?
          >[/color]

          Comment

          • xhoster@gmail.com

            #6
            Re: Perl portability

            Hendry Taylor <hendry.taylor@ btinternet.com> wrote:[color=blue]
            > I wrote a perl script and tested it on windows and it works fine. I then
            > moved it onto a solaris machine and now it says that there is a syntax
            > error with the following line of code:
            >
            > $user1 = "User name: ".$rec1[0];
            >
            > the line of code just before that is:
            >
            > @rec1 = split(/@/, $autotrack[$records]);[/color]

            This line by itself seems fine in perl -c, but deparse chokes on it:

            []$ perl -MO=Deparse,-p
            @rec1 = split(/@/, $autotrack[$records]);
            Can't call method "isa" without a package or object reference at
            /usr/lib/perl5/5.8.0/i386-linux-thread-multi/B/Deparse.pm line 1081. CHECK
            failed--call queue aborted.

            I don't know if this is somehow related to your problem or not.

            I suspect your problem may stem from your use of Switch.

            Xho

            --
            -------------------- http://NewsReader.Com/ --------------------
            Usenet Newsgroup Service $9.95/Month 30GB

            Comment

            • Hendry Taylor

              #7
              Re: Perl portability

              Is it possible that the switch is not fully supported.

              If i were to take the switch out my code suddenly become alot more
              complicated and I prefer KISS.


              xhoster@gmail.c om wrote:[color=blue]
              > Hendry Taylor <hendry.taylor@ btinternet.com> wrote:
              >[color=green]
              >>I wrote a perl script and tested it on windows and it works fine. I then
              >>moved it onto a solaris machine and now it says that there is a syntax
              >>error with the following line of code:
              >>
              >>$user1 = "User name: ".$rec1[0];
              >>
              >>the line of code just before that is:
              >>
              >>@rec1 = split(/@/, $autotrack[$records]);[/color]
              >
              >
              > This line by itself seems fine in perl -c, but deparse chokes on it:
              >
              > []$ perl -MO=Deparse,-p
              > @rec1 = split(/@/, $autotrack[$records]);
              > Can't call method "isa" without a package or object reference at
              > /usr/lib/perl5/5.8.0/i386-linux-thread-multi/B/Deparse.pm line 1081. CHECK
              > failed--call queue aborted.
              >
              > I don't know if this is somehow related to your problem or not.
              >
              > I suspect your problem may stem from your use of Switch.
              >
              > Xho
              >[/color]

              Comment

              • Darren Dunham

                #8
                Re: Perl portability

                Hendry Taylor <hendry.taylor@ btinternet.com> wrote:[color=blue]
                > Well here is the entire code it is rather long. It just says syntax
                > error on line 55 near $user1[/color]

                I couldn't get that message at all when I tried to run the code. I
                checked it under 5.8.7, so it may be something to do with perl or one of
                the modules (like Switch) between our versions.
                [color=blue]
                > #!/usr/bin/perl
                > use Tie::File;
                > use Switch;
                > sub trimwhitespace( $);
                > sub nslookup();[/color]

                Now I got a lot of whining about that. You don't need this line at all,
                and you probably want to remove the parentheses where you define the
                subroutine.
                [color=blue]
                > sub nslookup() {[/color]

                to

                sub nslookup {

                Of course, you could just use gethostent instead of calling nslookup,
                but that's not causing your syntax error.

                After changing those two lines...
                $ perl -w article
                Useless use of localtime in void context at article line 289.
                Possible precedence problem on bitwise & operator at article line 326.
                Name "main::user " used only once: possible typo at article line 58.
                Name "main::rund ate" used only once: possible typo at article line 27.
                Name "main::item " used only once: possible typo at article line 49.
                Name "main::serverli st" used only once: possible typo at article line 33.
                Name "main::FILEWRIT E" used only once: possible typo at article line 35.
                readline() on closed filehandle FILEREAD at article line 17.
                Use of uninitialized value in concatenation (.) or string at article line 19.
                readline() on closed filehandle FILEREAD at article line 27.
                Use of uninitialized value in concatenation (.) or string at article line 42, <$fh> line 16.
                untie attempted while 1 inner references still exist at article line 309, <$fh> line 16.

                No syntax errors...

                --
                Darren Dunham ddunham@taos.co m
                Senior Technical Consultant TAOS http://www.taos.com/
                Got some Dr Pepper? San Francisco, CA bay area
                < This line left intentionally blank to confuse you. >

                Comment

                • A. Sinan Unur

                  #9
                  Re: Perl portability

                  Hendry Taylor <hendry.taylor@ btinternet.com> wrote in
                  news:dgc6t8$gdb $1@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com:
                  [color=blue]
                  > Well here is the entire code it is rather long. It just says syntax
                  > error on line 55 near $user1[/color]

                  This is just plain rude. Post the shortest possible script that still
                  exhibits the problem.

                  By the way, who wrote this crap?
                  [color=blue]
                  > #!/usr/bin/perl[/color]

                  use warnings;
                  use strict;

                  missing.
                  [color=blue]
                  > use Tie::File;
                  > use Switch;
                  > sub trimwhitespace( $);
                  > sub nslookup();[/color]

                  What, can you tell me, is the purpose of declaring that a sub called
                  nslookup takes no arguments?

                  #!/usr/bin/perl
                  use strict;
                  use warnings;

                  sub sub_with_empty_ prototype () { print "@_\n" }

                  sub_with_empty_ prototype(qw'pa ss some args');

                  __END__

                  Run that script and see what happens.

                  Now, if I copy and paste your script, I get:

                  D:\Home\asu1\Us eNet\clpmisc> perl -c c.pl
                  Too many arguments for main::nslookup at c.pl line 32, near "'Address') "
                  BEGIN not safe after errors--compilation aborted at c.pl line 42.

                  So, I do not believe you when you say your script runs fine on a later
                  version of Perl.

                  Seeing code like this makes me respect people who work in the real
                  world, who have to fix messes like this to make things right.
                  [color=blue]
                  > $debug = 0;
                  > chdir("/usr/local/home/autosys/seos_autotrack" );
                  > $auditrecords = 0;
                  > $n = 0;
                  > $srecords = 0;
                  > $arecords = 0;
                  > $index = 0;
                  > $totalmatched = 0;
                  > $totalunmatched = 0;[/color]

                  What are all these global variables. Declare variables in the smallest
                  applicable scope.
                  [color=blue]
                  > my @monthnames = (qw(dummy Jan Feb Mar Apr May Jun Jul Aug Sep Nov
                  > Dec));[/color]

                  Cute.

                  open FILEREAD, "<seos_autotrac k_day";

                  open FILEREAD, '<', 'seos_autotrack _day'
                  or die "Cannot open seos_autotrack_ day: $!";
                  [color=blue]
                  > $runday = <FILEREAD>;
                  > close FILEREAD;
                  > $logfilename = "autotrack-seos-compare".$runda y.".log";[/color]

                  my $logfilename = "autotrack-seos-compare$runday. log";
                  [color=blue]
                  > use Fcntl 'O_RDWR', 'O_CREAT';
                  > my $o = tie @logfile, 'Tie::File', $logfilename, mode => O_RDWR |
                  > O_CREAT, dw_size => 512;
                  > $logrecords = @logfile;
                  > if ($logrecords > 0) {splice @logfile, 0, $logrecords;}
                  > $o->STORE($n, "Debug mode set to: ".$debug);
                  > open FILEREAD, "<seos_autotrac k_date";
                  > $rundate = <FILEREAD>;
                  > close FILEREAD;
                  > tie @servers, 'Tie::File', 'servers' || die "Can't open: $!\n";[/color]

                  I don't think this will actually die on error.
                  [color=blue]
                  > foreach $server (@servers)
                  > {
                  > $iplist = nslookup($serve r, 'Address');[/color]

                  What do you think this will return?

                  Why is $iplist a scalar?
                  [color=blue]
                  > $serverlist{$ip list} = sprintf "%s",$serve r;[/color]

                  This is sick. What do you think is the difference between

                  sprintf "%s",$serve r;

                  and

                  "$server"
                  [color=blue]
                  > $serverlist1{$s erver} = sprintf "%s",$iplis t;[/color]

                  Ditto.
                  [color=blue]
                  > print FILEWRITE "$server $iplist\n";
                  > }
                  > untie @servers;
                  > local $now = time;
                  > ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
                  > localtime(time) ;[/color]

                  I can't read any more.

                  Have you seen the posting guidelines?

                  Sinan

                  --
                  A. Sinan Unur <1usa@llenroc.u de.invalid>
                  (reverse each component and remove .invalid for email address)

                  comp.lang.perl. misc guidelines on the WWW:

                  Comment

                  • Tad McClellan

                    #10
                    Re: Perl portability

                    axel@white-eagle.invalid.u k <axel@white-eagle.invalid.u k> wrote:
                    [color=blue]
                    > I have a vi
                    > mug[/color]


                    But how do you get it into "beep mode"?


                    --
                    Tad McClellan SGML consulting
                    tadmc@augustmai l.com Perl programming
                    Fort Worth, Texas

                    Comment

                    • Hendry Taylor

                      #11
                      Re: Perl portability

                      Hendry Taylor wrote:[color=blue]
                      > I wrote a perl script and tested it on windows and it works fine. I then
                      > moved it onto a solaris machine and now it says that there is a syntax
                      > error with the following line of code:
                      >
                      > $user1 = "User name: ".$rec1[0];
                      >
                      > the line of code just before that is:
                      >
                      > @rec1 = split(/@/, $autotrack[$records]);
                      >
                      >
                      > any ideas?
                      > I can't see that there is anything uniquely windows about that. There is
                      > a difference in the version of perl in that on the windows box I have
                      > active state v5.8.6 and the solaris box has solaris perl 5.00.3 or
                      > something like that.[/color]

                      Just as some feedback, I upgraded the perl from 5.00.5 to 5.8.4 and it
                      now works fine. The older version did not like my switch and case.

                      Comment

                      Working...