[11718] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5318 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 7 08:27:20 1999

Date: Wed, 7 Apr 99 05:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 7 Apr 1999     Volume: 8 Number: 5318

Today's topics:
    Re: backgroup job with "at" command <ronald_f@my-dejanews.com>
        buggy counter? <mis@sparc.spb.su>
    Re: Debugger has problems with forking programs. <Wm.Blasius@ks.sel.alcatel.de>
    Re: determining the browser? <Philip.Newton@datenrevision.de>
    Re: How to "my" a file handle (Bart Lateur)
    Re: leap year? (Bart Lateur)
    Re: Most elegant random string generator? (Jonathan Stowe)
    Re: my random doesn't return number!! <Philip.Newton@datenrevision.de>
    Re: my random doesn't return number!! (Bart Lateur)
    Re: need to make http request <ebohlman@netcom.com>
    Re: No clues to Win32::NetResource problem? <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
    Re: Perl as a first programming language - suitability, (Andrew Johnson)
    Re: quick question... <Philip.Newton@datenrevision.de>
    Re: random number ( -w ) <indexfinger@usa.net>
    Re: random number ( -w ) (Sam Holden)
    Re: random number ( -w ) <indexfinger@usa.net>
    Re: random number ( -w ) (Sam Holden)
    Re: random number ( -w ) (Jonathan Stowe)
    Re: random number ( -w ) (Bart Lateur)
    Re: random number <indexfinger@usa.net>
        system problem <mecks@ust.hk>
    Re: This proverbial "perldoc". <Philip.Newton@datenrevision.de>
    Re: using "require example.cgi" on NT <indexfinger@usa.net>
    Re: using "require example.cgi" on NT (Sam Holden)
    Re: using "require example.cgi" on NT (Bob Trieger)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 07 Apr 1999 11:29:54 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: backgroup job with "at" command
Message-Id: <7effjd$rup$1@nnrp1.dejanews.com>

In article <7e9nhs$3m5$1@nnrp1.dejanews.com>,
  userjeff@my-dejanews.com wrote:
> I use the command "at" in FreeBSD and have the following problem that I
> do not have in UNIX(Digital 4.0U). I have one a script written in perl5,
> say, test.pl  It works fine when I type "test.pl" in FreeBSD.But it does not
> work when I type
> at -f test.pl now  1 minute
> (In UNIX(Digital), it is fine with the command: at now  1 minute test.pl  )
> I think the main problem is in FreeBSD the default env. for at is /bin/sh
> But I do not know how to solve this problem.

You could write a shell script that does nothing more than call your test.pl.

Also make sure that test.pl is in the right PATH at the time "at" is executed.
If in doubt, use absolute path names for locating the shell script and your
test.pl, i.e.:

# sh-script /home/bonnie/bin/call-test to call test.pl
/home/bonnie/bin/test.pl

at -f /home/bonnie/bin/call-test now 1 minute

--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Wed, 7 Apr 1999 15:40:32 +0400
From: Manida Ivan <mis@sparc.spb.su>
Subject: buggy counter?
Message-Id: <Pine.GSO.4.02.9904071531490.29274-100000@minerva.sparc.spb.su>

Hello fellow perl wizards,
 
a simple question that might be just some major misunderstanding on my
side. Anyway, please tell me why the following simpliest counter
(irrelevant parts left aside) resets the count to zero every few days or
so (in general, it works allright):

#!/usr/bin/perl

my $data_file = "../data/visits.cnt";

open(COUNT,"$data_file") || die "can't open counter file";
my $count = <COUNT>;
close(COUNT);
chop($count) if $count =~ /\n$/;

$count++;

open(COUNT,">$data_file") || die "couldn't write";
&lock(COUNT);
print COUNT "$count";
&unlock(COUNT);
close(COUNT);

#and some functions 

my $file;
sub lock {
 $file = @_;
 flock($file,2);
 seek($file, 0, 2);
}

sub unlock {
 $file=@_;
 flock($file,8);
}
 
# end of functions

Please point me at where this ugly bug is. It seems to me that under no
condition it could be reset to zero, apparently I'm totally wrong, so any
advice would be very much appreciated.

The script could be called by a number of visitors at once (that's
what the counters are for anyway), and I suppose it to be some weird
locking problem. 

TIA,

-- 
PiRaMidA aka Ivan S. Manida



------------------------------

Date: Wed, 07 Apr 1999 11:47:42 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
Subject: Re: Debugger has problems with forking programs.
Message-Id: <370B29BE.41C67EA6@ks.sel.alcatel.de>

Ilya Zakharevich wrote:
> 
> [A complimentary Cc of this posting was sent to William Blasius #42722
> <Wm.Blasius@ks.sel.alcatel.de>],
> who wrote in article <3702667A.167EB0E7@ks.sel.alcatel.de>:
> > Ilya Zakharevich wrote:
> 
> A blind Cc again!  Please never Cc your postings without marking them
> as such.
> 
> Anyway, it is too late - I already answered this in private mail.  My
> answer was basically:  upgrade and/or learn to write proper bug reports.
> 
> Ilya

You are a vicious bastard, aren't you?

You send me mail, you get mail back and I don't have the slightest
notion of why you would care if the rest of the newsgroup knows if
you got an Email Cc: or not. If you're all that het up about it, I
suggest you just killfile all mails with Newsgroups: in the header
and be happy.

To correct the misimpression you left with this post, it seems you
didn't even bother to read my previous posts (including one I Cc'd
to you in response to your mail to me - that's 'C' as in courtesy,
maybe you should look it up; try Webster's courtesy), indulging in
a bit of self-aggrandizing vitriol instead. For your information I
did not write a bug report, I asked for information and/or help.

For the information of others who might be interested, the Perl is
perl version 5.004 running under Solaris and the behaviour doesn't
seem to be related to the STDIN tty - the program will switch into
trace mode and trace its way right out the end of the debugger and
return to the shell even if the keyboard isn't touched after doing
the c(ontinue) after the first debugger prompt.

Thanks for any insight,

Wm Blasius
--
 ....now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!


------------------------------

Date: Wed, 07 Apr 1999 12:35:56 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: determining the browser?
Message-Id: <370B350C.DCDF68E@datenrevision.de>

Jason Simms wrote:
> 
> print "You are using IE" if user_agent()=~ /MSIE/;
> 
> print "You are using Netscape" if user_agent()=~ /Mozilla/;

AFAIK, MSIE also has "Mozilla" in its string (e.g.
"Mozilla-2-0-Compatible-Msie-3-0B-Windows95-1024,768" -- from the
Browsercaps result page at
http://www.browsercaps.com/config/Cv/Generated/resultsbyname.html). That
page has nothing containing "MSIE" (only a couple with "Msie").

But then, there are proxies which will filter out the User-Agent, and of
the course the browser can feel free to lie about itself (as I have
heard some browsers claim to be e.g. Netscape, in order to view pages
that have been made for Netscape). Or, if you use e.g. telnet or LWP,
you can make up a User-agent string out of thin air (see Abigail's
post).

I suppose the real question is why would you want to determine the
browser type at all? Valid, portable HTML should render equally well in
MSIE, Netscape Navigator/Communicator, Lynx, NCSA Mosaic, and
what-have-you.

Cheers,
Philip


------------------------------

Date: Wed, 07 Apr 1999 11:23:35 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to "my" a file handle
Message-Id: <370f1244.2862910@news.skynet.be>

Pedro Garrett wrote:

>I read the FAQ on how to "local" a file handle, but how do I "my" one?  Or
>is there maybe no reason to do this?

There is no necessity to do it, local() is fine, but there's also a
reason why it can't happen: typeglobs. The way perl stores global
variables is completely different from how it stores my'ed variables. I
found info on this in the O'Reilly "Advanced Perl Programming" book.,
but it may be availeable in the online docs as well.

Try imagining how Perl stores "global" variables: in hashes. The keys
are the variable's name, without the prefix ('$x' is stored under 'x').

The values of these hashes contain a "record" (as in other programming
languages, not as in plain Perl) of all sorts of subtypes, with their
associated data: there's an entry for a scalar ($x), one for the array
(@x), one for the hash (%x), but more still, including subs (sub x) and
filehandles (x).

This record is called a typeglob, and is written as "*x". The hash
containing these typeglobs is called a "stash", short for "Symbol Table
hASH", and can be accessed in perl through "%package::". There is one
stash per package.

Here's some basic code to experiment with this a little:

#! perl
  $scalar = 10;
  $hash{yes} = 'no';
  @ary = (1..3);

  dumpVars();

  sub dumpVars {
	local($",$\) = ' ';
	foreach my $name (sort keys %main::) {
		local *alias = $main::{$name}; 
			# copy typeglob into typeglob
		if(defined $alias) {
			print "\$$name = $alias\n";
		}
		if(defined @alias) {
			print "\@$name = @ary\n";
		}
		if(defined %alias) {
			my @hash = %alias; 
			print "\%$name = @hash\n";
		}
	}
  }
__END__


Using local() on a variable, puts the current value out of the stash,
onto a stack, and clears it (or assigns a RHS to it). It is popped back
from the stack to it's original place, at the end of the enclosing
block. So local() isn't "local" at all, but rather, it is "temporarily"
a new value. It is a temporal localization, not positional.

Using my() on a variable creates a new slot for a variable, but a
different one for a scalar, an array or a hash. All references in the
enclosing block reference this new slot, not the one in the stash.
(Therefore, package names DON'T have any effect at all, on my'ed
variables.)

That also explains why my cannot be used on filehandles. it is limited
to scalars, arrays and hashes ONLY. But I don't really see why you'd
need it. After all, opening a file is a *temporal* effect, too, so it
makes sense to be able to access a particular opened file through one
particular handle.

One more remark about assigning to a typeglob: this is a bit special. If
you assign a reference, say a hash reference, to a typeglob, this will
only replace the HASH entry in the typglob, and create an alias to the
original hash. The rest of the typeglob is not affected.

  #! perl -w
  $x = 10;
  %y = ('Y' => 'yes');
  *x = \%y;
  $x{N} = 'no';  # new entry in %y
  print "\$x = $x, \$x{Y} = $x{Y}, \$y{N} = $y{N}\n\n";
__END__
$x = 10, $x{Y} = yes, $y{N} = no

	Bart.


------------------------------

Date: Wed, 07 Apr 1999 11:23:38 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: leap year?
Message-Id: <370d0c5c.1352088@news.skynet.be>

Larry Rosler wrote:

>> Just check:
>> year divisble by 4?  then yes
>>   year divisible by 100?  then no
>>     year divisible by 400?  then yes
>
>Those three checks are in the wrong order.  But reversing the order is 
>less efficient than doing them in that order, but with more elaborate 
>logic than 'yes' if the first test succeeds.

Or, reverse the tests.

 year not divisible by 4?  then no else:
   year not divisible by 100?  then yes else:
     year not divisible by 400?  then no else:
       yes

	Bart.


------------------------------

Date: Wed, 07 Apr 1999 10:56:50 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Most elegant random string generator?
Message-Id: <370b3941.10941563@news.dircon.co.uk>

On Tue, 06 Apr 1999 16:42:58 -0700, Greg McCann <gregm@well.com>
wrote:

>The following simple program generates a random string of characters
>(it's being used as a session ID in a web application).  It works well,
>but being new to Perl I'm wondering if there is a more efficient and/or
>elegant way of doing this - without being TOO obfuscatory!
>

Depends whether you randomness or portability ;-}  For pretty damned
random on a Linux (or other machine that supports /dev/urandom):

#!/usr/bin/perl

open(RANDOM,"/dev/urandom") || die "No random device - $!\n";

while(read(RANDOM,$_,1))
  {
     if (/\w/)
       {
        $randstring .= $_;
       }
     last if (length($randstring) == 8 );
  }

close RANDOM;

print $randstring;


/J\


------------------------------

Date: Wed, 07 Apr 1999 11:13:56 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: my random doesn't return number!!
Message-Id: <370B21D4.DA5F55F8@datenrevision.de>

Bart Lateur wrote:
> 
> The "keyword step" is unnecessary, anyway. The keyword itself is never
> retained! Just an array of the *values* of the hash is enough!
> 
>         @value = values %hash;
>         return $value[int(rand @values)];

The "@value" step is unnecessary, anyway. The array itself is never
retained! Just writing the two lines in one is enough!

    return $value[int(rand values %hash)];

Unless I am missing something?

Cheers,
Philip


------------------------------

Date: Wed, 07 Apr 1999 11:27:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: my random doesn't return number!!
Message-Id: <370c409d.180593@news.skynet.be>

Philip Newton wrote:

>> The "keyword step" is unnecessary, anyway. The keyword itself is never
>> retained! Just an array of the *values* of the hash is enough!
>> 
>>         @value = values %hash;
>>         return $value[int(rand @values)];
>
>The "@value" step is unnecessary, anyway. The array itself is never
>retained! Just writing the two lines in one is enough!
>
>    return $value[int(rand values %hash)];
>

>Unless I am missing something?

We don't need a hash!

	@value = qw(red green blue);
        return $value[int(rand @value)];

	Bart.


------------------------------

Date: Wed, 7 Apr 1999 11:41:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: need to make http request
Message-Id: <ebohlmanF9tHss.F95@netcom.com>

jdinkler@my-dejanews.com wrote:
: I have to send a http request to a daemon on a server - and would like to do
: this in perl. I can request via a browser, but this lacks the ability to
: script the responses.

The LWP module contains everything you need to do this.



------------------------------

Date: Wed, 7 Apr 1999 02:46:51 -0700
From: "Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Subject: Re: No clues to Win32::NetResource problem?
Message-Id: <cPFO2.8555$nX2.8708889@news1.giganews.com>

Uwe W. Gehring wrote in message <370A8306.E45011B1@politik.uni-mainz.de>...
>Does not help. The following modification:
>
>$server = Win32::AdminMisc::GetPDC($domain);
>
>Win32::NetResource::NetShareGetInfo($myshare,\%share_info,$server)
> || die "Unable to get share information\n";
>
>brings neither the desired output nor an error message (not even with
>diag. and -w).
>

Ahhh. For some reason Win32::NetResource::NetShareGetInfo() requires
that the second parameter be a scalar, not a hash reference. If the
function is successful then the scalar will be set as a hash reference.
Try this:
 Win32::NetResource::NetShareGetInfo( $myshare, $share_info, $server );
 print "The Share path is: $share_info->{remark}.

Cheers,
dave
--
=================================================================
Dave Roth                                ...glittering prizes and
Roth Consulting                      endless compromises, shatter
http://www.roth.net                     the illusion of integrity
Win32, Perl, C++, ODBC, Training
rothd at roth dot net

Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
http://www.roth.net/books/extensions/





------------------------------

Date: Wed, 07 Apr 1999 09:32:21 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Perl as a first programming language - suitability, good books ?
Message-Id: <FCFO2.3093$Ps4.329031@news.rdc1.on.wave.home.com>

In article <MPG.11743667a17dd632989852@nntp.hpl.hp.com>,
 Larry Rosler <lr@hpl.hp.com> wrote:
[snip]

! This person is not far enough along even for the Llama book.  There was 
! a thread about this recently, and I don't recall anyone proposing a Perl 
! book for beginners in programming.  Search DejaNews for more.

Actually, I have one aimed at *just* that audience ... 'The Elements
of Programming with Perl' from Manning Publications ... it is going 
into the production phase very soon now, but that'll still take a
couple/few months before it hits the shelves.

regards
andrew



------------------------------

Date: Wed, 07 Apr 1999 11:33:13 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: quick question...
Message-Id: <370B2659.85AA4ECD@datenrevision.de>

Larry Rosler wrote:
> 
> Just for the record, I have had success using the 'Cancel Article'
> capability of my newsreader to get rid of the bad post, then resend it
> with the corrected text.  Some readers may see the first version, but I
> think no one should see two versions.

Some news hosts don't honour Cancel requests (for various reasons).
People using such hosts would see two articles.

Cheers,
Philip


------------------------------

Date: Wed, 07 Apr 1999 09:12:43 GMT
From: "IndexFinger.com" <indexfinger@usa.net>
Subject: Re: random number ( -w )
Message-Id: <fkFO2.382$zE3.10661@typhoon.nycap.rr.com>

> You'd think people would at least read the 'perl' manpage/perldoc
> if not the rest...

Can't you just tell me?


--
========================================================
BigTalker - http://www.bigtalker.com
Want more traffic? Give them a reason to return.
BigTalker - the newest and faster bulletin board system.





------------------------------

Date: 7 Apr 1999 09:19:53 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: random number ( -w )
Message-Id: <slrn7gm8pp.q01.sholden@pgrad.cs.usyd.edu.au>

On Wed, 07 Apr 1999 09:12:43 GMT, IndexFinger.com <indexfinger@usa.net> wrote:
>> You'd think people would at least read the 'perl' manpage/perldoc
>> if not the rest...
>
>Can't you just tell me?

I'm now going to assume you are joking...

-- 
Sam

Computers in the future may weigh no more than 1.5 tons.
	--Popular Mechanics, 1949


------------------------------

Date: Wed, 07 Apr 1999 10:31:53 GMT
From: "IndexFinger.com" <indexfinger@usa.net>
Subject: Re: random number ( -w )
Message-Id: <tuGO2.280$xI5.10449@typhoon.nycap.rr.com>

> I'm now going to assume you are joking...

I'm not.






------------------------------

Date: 7 Apr 1999 10:41:10 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: random number ( -w )
Message-Id: <slrn7gmdi6.rb8.sholden@pgrad.cs.usyd.edu.au>

On Wed, 07 Apr 1999 10:31:53 GMT, IndexFinger.com <indexfinger@usa.net> wrote:
>> I'm now going to assume you are joking...
>
>I'm not.

Well read your own bloody documentation then. I'm not going to tell you
the answer to a question that is answered in the documentation you 
have.

-- 
Sam

There's no such thing as a simple cache bug.
	--Rob Pike


------------------------------

Date: Wed, 07 Apr 1999 10:50:34 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: random number ( -w )
Message-Id: <370b3846.10690743@news.dircon.co.uk>

On Wed, 07 Apr 1999 06:52:10 GMT, "IndexFinger.com"
<indexfinger@usa.net> wrote:

>> #!usr/bin/perl -w
>
>
>What does the "-w" do?
>
>

P:\>perl -e "print $fish"

P:\>perl -we "print $fish"
Name "main::fish" used only once: possible typo at -e line 1.
Use of uninitialized value at -e line 1.

Thats what it does

/J\


------------------------------

Date: Wed, 07 Apr 1999 11:23:40 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: random number ( -w )
Message-Id: <370e0e29.1812909@news.skynet.be>

IndexFinger.com wrote:

>> #!usr/bin/perl -w
>
>What does the "-w" do?

Turn on warnings.

The effect is the same as adding the string "-w" between the names of
the executable ("perl") and of the script:

	perl -w script.pl ...

or as setting $^W in a BEGIN block (I'm not sure this covers EVERY case,
but it sure enables the "variable used only once" warning):

	#! perl
	BEGIN {
		$^W = 1;
	}
	....

Without the "BEGIN", you wouldn't get compile-time warnings.

Perl is very permissive about function failures by default. Too
permissive, that is what many people think. This makes it rather
difficult to track bugs, or even KNOW that there are bugs.

Switching on warnings makes perl print a warning text line to STDERR,
for suspicious statements (compile-time or runtime), as if printed by
warn(), on many of those failed lines. Though, still not on failures()
for open(), for example.

It's a good idea to switch on warnings. Any occurence of a warning that
you didn't expect, deserves closer inspection. If you DID expect it, you
can temporarily disable warnings like:

	{
		local $^W;
		... 	# statement that would give a warning,
			# but does what you want, anyway
	}

	Bart.


------------------------------

Date: Wed, 07 Apr 1999 09:13:45 GMT
From: "IndexFinger.com" <indexfinger@usa.net>
Subject: Re: random number
Message-Id: <dlFO2.383$zE3.10672@typhoon.nycap.rr.com>

Try:

$number = int(rand 10) + 1;



--
========================================================
BigTalker - http://www.bigtalker.com
Want more traffic? Give them a reason to return.
BigTalker - the newest and faster bulletin board system.




------------------------------

Date: Wed, 07 Apr 1999 17:53:24 +0800
From: Chim Kin Sang <mecks@ust.hk>
Subject: system problem
Message-Id: <370B2B14.496FF83E@ust.hk>

Hi,
        I have write a code in PERL which have to call a csh script and
pass some argument to it.
But I found some problem on the command system. Can someone give me some
suggest?

If I am in csh. I have to type                  graph.csh 1 1 DATA >
test
which graph.csh is the csh script,
1 1  are two arguments the scirpt needed
DATA is the file that the csh scirpt act on
test is just the STDOUT file


If I write in PERL
    system("graph.csh 1 1 DATA > test");
it don't work. And the most strange thing is that
it blamed on my csh script and said error on the
csh script which it run ok on csh.

   I know that PERL call up the sh but not csh.
Did it causes the problem?

Thanks
Jim



------------------------------

Date: Wed, 07 Apr 1999 13:01:02 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: This proverbial "perldoc".
Message-Id: <370B3AEE.67C40B61@datenrevision.de>

Abigail wrote:
> 
> If it isn't in your path, and perl resides in the same directory, you
> aren't likely to run perl either..... Of course, if it isn't in your
> path, which won't find it....

Not so. For example, on our HP-UX box, perldoc and perl both reside in
/opt/perl5/bin, which is not (by default) in my path. However, someone
thoughtfully provided a symlink /usr/bin/perl -> /opt/perl5/bin/perl. So
I can run perl (because /usr/bin is in my default path), but not perldoc
(unless I put /opt/perl5/bin into my $PATH -- which I have).

Cheers,
Philip


------------------------------

Date: Wed, 07 Apr 1999 09:51:49 GMT
From: "IndexFinger.com" <indexfinger@usa.net>
Subject: Re: using "require example.cgi" on NT
Message-Id: <VUFO2.384$zE3.10716@typhoon.nycap.rr.com>

> Because you forgot the quotes. If you read the error message is should
> be reasonably obvious that it is looking for examplecgi...


I get an error when I use:

require "example.cgi";






------------------------------

Date: 7 Apr 1999 10:19:32 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: using "require example.cgi" on NT
Message-Id: <slrn7gmc9k.qu8.sholden@pgrad.cs.usyd.edu.au>

On Wed, 07 Apr 1999 09:51:49 GMT, IndexFinger.com <indexfinger@usa.net> wrote:
>
>I get an error when I use:
>
>require "example.cgi";

And if you posted the error someone might be able to tell you what the
problem is. Most probably that the directory it is in isn't in @INC.

-- 
Sam

Computers in the future may weigh no more than 1.5 tons.
	--Popular Mechanics, 1949


------------------------------

Date: Wed, 07 Apr 1999 10:26:26 GMT
From: sowmaster@huicepigs.com (Bob Trieger)
Subject: Re: using "require example.cgi" on NT
Message-Id: <7efbq3$oq7$1@oak.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]

"IndexFinger.com" <indexfinger@usa.net> wrote:
>
>
>When I use the below code on NT, I get an error:
>
>require example.cgi;
>
>
>But this doesn't:
>
>require "C:\path\to\example.cgi";

Where is the exampl.cgi? is the directory where it resides in perl's 
path? 

You can add the directory to the path, type out the entire path in the 
require call or you can simply put example.cgi in a directory that is in 
the path.

Good luck,
Bob Trieger
sowmaster@juicepigs.com



------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5318
**************************************

home help back first fref pref prev next nref lref last post