[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Problem w/making runtime version of script



On Mon, Aug 09, 1999 at 06:18:32PM -0700, Bruce Van Allen wrote:
} At 10:42 AM -0600 8/9/99, Brenda Cannon wrote:
} >I have the following snippet of code at the beginning of one of my
} >scripts:
} >
} >#!/usr/local/bin/perl -w
} >#use strict
} >
} >use constant FALSE => 0;
} >use constant TRUE => 1;
} >
} >use Getopt::Long;
} >use Config;
} >
} >require "shellwords.pl";
} >require "GUSI.ph";
} >
} >
} >The problem is that when I actually tried making a runtime version of
} >this script it saved it with no errors/warnings, but then when I
} >actually try to run it on the other machine I get the error that it
} >cannot locate constant.pm in @INC.  Can anyone tell me what is going on
} >here?
} 
} The statement
} 
} 	use constant whatever
} 
} is not Perl.  :-)

Sure it is:

linux% perl
use constant; 
linux% man constant
constant(3)      Perl Programmers Reference Guide     constant(3)

NAME
       constant - Perl pragma to declare constants

SYNOPSIS
           use constant BUFFER_SIZE    => 4096;
           use constant ONE_YEAR       => 365.2425 * 24 * 60 * 60;
           use constant PI             => 4 * atan2 1, 1;
           use constant DEBUGGING      => 0;
           use constant ORACLE         => 'oracle@cs.indiana.edu';
           use constant USERNAME       => scalar getpwuid($<);
           use constant USERINFO       => getpwuid($<);

etc.

linux% perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.10, archname=ppc-linux

It's even there under MacPerl, which is 5.004, so it's been around at
least that long:

linux% ls /The_Black_Pits/Applications/MacPerl\ :c4/lib/constant.pm 
/The_Black_Pits/Applications/MacPerl :c4/lib/constant.pm


[snip]
} 
} On a related topic: it looks like what you're doing is setting true & 
} false variables or constants, and that's not the way it works in Perl 
} either ... :-)

Before writing about how Perl works, it's best to make sure how Perl
works.

} 
} 
} - Bruce
} 
} __Bruce_Van_Allen___bva@cruzio.com__831_429_1688_V__
} __PO_Box_839__Santa_Cruz_CA__95061__831_426_2474_W__
} 

-- 
Paul Schinder
schinder@pobox.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org