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

179Re: [NTS] ^!RunPerl question

Expand Messages
  • Alan C.
    Dec 2, 2002
    • 0 Attachment
      Hello,

      Just to share a NTB/Perl (mostly perl) tidbit that I discoverd

      >H="_pl_trmleadspace"
      >#!/perl/bin/perl -w
      >while ($line = <>) {
      > for ($line =~ s/^ +//) {
      > print $line;
      > }
      >}

      I discovered a shorter/less perl code that still accomplishes the exact same task. The below clip is a replacement for the above clip. It's more/closer like the perl script in samplecode library--it uses perl's default variable: $_

      H="_pl_trmleadspace"
      #!/perl/bin/perl -w
      while (<>) {
      s/^ +//;
      print "$_";
      }
      # end

      --
      Alan.
    • Show all 3 messages in this topic