[7694] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1320 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 14 18:16:31 1997

Date: Fri, 14 Nov 97 15:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 14 Nov 1997     Volume: 8 Number: 1320

Today's topics:
     Re: ./[script.pl] not working <mgb@nbnet.nb.ca>
     Re: ./[script.pl] not working (brian d foy)
     Re: 500 Internal Server Error <accu-scan@worldnet.att.net>
     Re: Block comments in Perl? <usenet-tag@qz.little-neck.ny.us>
     Re: Block comments in Perl? (brian d foy)
     calendar code (Todd Wallace)
     Re: cgi help (David Jacoby)
     changing text to upper case <dclark@rogers.wave.ca>
     Re: How To Test if number is ODD or EVEN? <ken@apisys.com>
     Re: How To Test if number is ODD or EVEN? (Bart Lateur)
     htpasswd help PLEASE! ... Thank You (hector Catre)
     Re: Matching a literal "interrobang" ?? <joegottman@worldnet.att.net>
     Multi-line substitution (adding newlines and global rep <steve.tolkin@fmr.com>
     Re: Multi-line substitution (adding newlines and global <steve.tolkin@fmr.com>
     Newbie Q: Skipping lines in output (A Lee)
     numeric format, commas, etc, like picture <Enrico.Silterra@nortel.com>
     Perl Javascript Interpreter <talkasab@opal.tufts.edu>
     Re: Perl/SQL help <rsmith@nac.net>
     Taint checking problem - insecure PATH <ernestm@towery.com>
     Re: Taint checking problem - insecure PATH (brian d foy)
     Re: Taint checking problem - insecure PATH <ernestm@towery.com>
     Trying to copy a file on winnt in perl... <dnichols@fhcrc.org>
     Re: Trying to copy a file on winnt in perl... (Mike Stok)
     WANTED:simple Perl CGI script (nospam)
     Re: WANTED:simple Perl CGI script (brian d foy)
     what's wrong in my simple module? (Trudno zhit' v derevne bez nagana.)
     xemacs comint support for perl shell? (Lynn D. Newton)
     xforms problems <froboz@cif.rochester.edu>
     Re: Y2000 Issues in PERL CGI scripts? <usenet-tag@qz.little-neck.ny.us>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 14 Nov 1997 05:17:38 -0400
From: Michael Butler <mgb@nbnet.nb.ca>
Subject: Re: ./[script.pl] not working
Message-Id: <346C1732.1BF483A3@nbnet.nb.ca>

mark@pla.to wrote:
> Did you use chmod to make it executable?
> Did you put in "#!/usr/bin/perl" as a first line? (or wherever the perl prg
> is?)
> 
> [root@mind cgi-bin]# ls t -l
> -rw-rw-r--   1 root     root           38 Nov 14 19:29 t
> 
> [root@mind cgi-bin]# cat t
> #! /usr/bin/perl
> print "This works!\n";
> 
> [root@mind cgi-bin]# ./t
> bash: ./t: Permission denied
> 
> [root@mind cgi-bin]# chmod 755 t
> 
> [root@mind cgi-bin]# ./t
> This works!
> [root@mind cgi-bin]#

Mark: I have had the same problem with trying to run a perl script. My
script is called tryperl and I did eveything you suggested. Why can't I
simply type the filename in to run the script? When I typed ./tryperl it
worked. What is the significance of the ./ ?

Thanks
Mike Butler


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

Date: Fri, 14 Nov 1997 16:12:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: ./[script.pl] not working
Message-Id: <comdog-ya02408000R1411971612000001@news.panix.com>

In article <346C1732.1BF483A3@nbnet.nb.ca>, Michael Butler <mgb@nbnet.nb.ca> wrote:

>mark@pla.to wrote:

>> [root@mind cgi-bin]# ./t
>> This works!
>> [root@mind cgi-bin]#

>Mark: I have had the same problem with trying to run a perl script. My
>script is called tryperl and I did eveything you suggested. Why can't I
>simply type the filename in to run the script? When I typed ./tryperl it
>worked. What is the significance of the ./ ?

the shell has to know where to find the script.  the . means it's in
the current directory.  depending on your shell, there are other ways
to rebuild the table of commands so that it finds new things in your
path, but you'd need to read the man page for your shell to find out
about that.

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
$RTFM_post{'brian d foy'}++;


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

Date: Fri, 14 Nov 1997 15:10:54 -0600
From: Mike Snyder <accu-scan@worldnet.att.net>
Subject: Re: 500 Internal Server Error
Message-Id: <64if0e$i76@bgtnsc03.worldnet.att.net>

> perldoc perlfaq9
> 
> read the FAQ.

I'm new, and getting this same error. You make reference to a FAQ to
read but you don't mention where it can be located. An oversight maybe?
I'd like to correct this problem if I can track down this FAQ.


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

Date: 14 Nov 1997 19:53:41 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Block comments in Perl?
Message-Id: <eli$9711141444@qz.little-neck.ny.us>

brian d foy <comdog@computerdog.com> wrote:
> frank.hoehne@hamburg.netsurf.de (Frank Hoehne) wrote:
> >On 10 Nov 1997 18:15:44 GMT, "Luu Tran" <luutran@geocities.com> wrote:
> >>This is dumb but how do I do block comments in Perl (5.003)?  
> >>style /* */ block comment is out, so how?
> >The use of the "here-doc" syntax 
> >will let you do /* */-block-comments.
> in your "solution", perl will create a new variable name and will grab
> a chunk of memory for it.
 ...
> since perl has built in block commenting features, ugly pseudo-solutions
> can be left at home.

I'm not sure I like the POD method. Anyone see problems with this:

  1 =~ m((?#

	Block comment that ends with the first close parenthesis.
	This is true multiline comment text, used in a no-op that
	hopefully gets optimized out. It will bugger your $1, etc
	variables, but it won't clobber the saved RE used for the
	m// blank RE context.

	));

Elijah
------
at least it doesn't clobber for 5.004


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

Date: Fri, 14 Nov 1997 15:29:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Block comments in Perl?
Message-Id: <comdog-ya02408000R1411971529500001@news.panix.com>

In article <eli$9711141444@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:

>  1 =~ m((?#
>
>        Block comment that ends with the first close parenthesis.
>        This is true multiline comment text, used in a no-op that
>        hopefully gets optimized out. It will bugger your $1, etc
>        variables, but it won't clobber the saved RE used for the
>        m// blank RE context.
>
>        ));

appears to have no effect on $1 and friends:

   #!/usr/bin/perl
   
   print "$]\n";
   
   $_ = 'janyph';
   
   m/ja(..)ph/;
   print "a. \$1 = $1\n";
   
   1 =~ m/ (?# comment ) /;
   print "b. \$1 = $1\n";
   
   $_ = 'jaNYph';
   
   m//;
   print "c. \$1 = $1\n";
   
   __END__
   5.004
   a. $1 = ny
   b. $1 = ny
   c. $1 = NY

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 14 Nov 1997 21:11:13 GMT
From: twallace@zippy.icma.org (Todd Wallace)
Subject: calendar code
Message-Id: <64ieph$p3@intra.icma.org>

Can someone point me to some calendar code in Perl?
I need something that does something like the "cal" command in UNIX.

Todd Wallace



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

Date: 14 Nov 1997 21:05:06 GMT
From: jacoby@harbor.ecn.purdue.edu (David Jacoby)
Subject: Re: cgi help
Message-Id: <64iee2$asq@mozo.cc.purdue.edu>

In article <346BA15D.38E4CCBA@mindspring.com>,
Phil Heaton  <ke4krt@mindspring.com> wrote:
>On my html form:

>input type="text" name="property_number" size=30


>	In my perl script:

>read(STDIN, $SearchFor, $ENV{CONTENT_LENGTH}) ;

>Let's say I enter CN021400 at the form. This sets
>$SearchFor to "property_number=CN021400". How do I
>get rid of "Property_number=" and just use "CN021400"??

Later in your perl script:

$SearchFor =~ /=/;
$SearchFor = $';

>Phil
>-- 
>Phil Heaton, ke4krt@atl.mindspring.com


-- 
 David Jacoby                           mailto:jacoby@ecn.purdue.edu
 Web Technician and Librarian  http://harbor.ecn.purdue.edu/~jacoby/
 Engineering Computer Network    What do you want? Perl can do that!
---------------------------------------------------------------------


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

Date: Fri, 14 Nov 1997 16:45:05 -0800
From: Debra Clark <dclark@rogers.wave.ca>
Subject: changing text to upper case
Message-Id: <346CF091.48D270AA@rogers.wave.ca>

When I try to change "test" into upper case...

$mm = "test"; print "input is $mm\n"; $nn = uc $mm; print "result is
$nn\n";

I get this error message:

# syntax error in file F:\OBBRP\TESTUC.PL at line 3, next 2 tokens "uc
$mm"
# Execution of F:\OBBRP\TESTUC.PL aborted due to compilation errors.

If anyone knows what I'm doing wrong, please e-mail me.  Thanks.



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

Date: Fri, 14 Nov 1997 14:47:57 -0700
From: "Ken Scott" <ken@apisys.com>
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <64igue$8vn$1@newman.pcisys.net>

if $counter % 2 == 0
{
   #value is even
}
else
{
   #value is odd
}


Jay Dixon wrote in message <346c1e03.4298330@news.dixonssurgical.co.uk>...
>I am slowly coming to grips with perl.  I can usually make a half
>decent job of hacking existing scripts but I have got myself stumped.
>
>I want to test if a variable is Odd (or Even) - i.e. I only want to
>run a bit of code every other pass.  I have never come across this as
>a bit of code.
>
>if $counter == [????] print "stuff"; # as far as I can get!
>
>Any suggestions will be much appreciated.
>
>Thanks
>Jay
>
>---------
>Jay Dixon - Dixons Surgical Ltd - Wickford - Essex - England
>jay@dixonssurgical.co.uk  -  http://www.dixonssurgical.co.uk




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

Date: Fri, 14 Nov 1997 23:05:33 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <346ed8d8.2632720@news.tornado.be>

toutatis@_SPAMTRAP_toutatis.net (Toutatis) wrote:

>> jay@dixonssurgical.co.uk (Jay Dixon) wrote:
>> 
>> >I want to test if a variable is Odd (or Even) - i.e. I only want to
>> >run a bit of code every other pass.  I have never come across this as
>> >a bit of code.
>> 
>> Two ways. 
>> 
>> 1) switch a value between 1 and 0.
>> 
>>         $go = 1 - $go;
>>         if ($go) { ... }
>
>Don't see how how this is supposed to help?!

You don't? Then I'll repeat a selected quote: 

> I only want to run a bit of code every other pass.

I think this will work nicely, even if it doesn't check if a number is
even or odd.

	Bart.


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

Date: Fri, 14 Nov 1997 20:20:37 GMT
From: hector@csgm.com (hector Catre)
Subject: htpasswd help PLEASE! ... Thank You
Message-Id: <64ibng$abf$1@goblin.uunet.ca>

O.K., I want to thank everyone that posted. I didn't know that the first two 
letters are the salt itself. It works just fine now. WHEW!

Hector Catre			"High Technology Can
Technical/Creative Coordinator	only be surpassed 
Carlson Sterling, Inc.		by even greater
Canada Division			intellegence"
Hector@CSGM.com			   H.G. Catre 1997


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

Date: Fri, 14 Nov 1997 17:26:58 -0500
From: Joe Gottman <joegottman@worldnet.att.net>
Subject: Re: Matching a literal "interrobang" ??
Message-Id: <64ijcb$bat@mtinsc02.worldnet.att.net>

Pete Holsberg wrote:
> 
> This is perl 5.004_01.
> 
> I'm trying to match the following string (for subsequent
> replacement)
> 
> /cgi-bin/htgrep.cgi/file=/AA/f97/msched.html&style=pre?AC106
> 
> but I haven't been able to figure out how to make that "?"
> literal. I've tried "\?" but that didn't work.
> 
> Any suggestions?
> 
> Thanks,
> Pete

   Use the quotemeta function. It automatically puts a \ in front of all 
metacharacters in a string. The way to do it is:

   my $regex =
quotemeta('/cgi-bin/htgrep.cgi/file=/AA/f97/msched.html&style=pre?AC106');
if   ($string =~ /$regex/o)
     {
     # do whatever
    }

Hope this helps.
-- 
Joe Gottman
joegottman@nospam.worldnet.att.net

[Remove nospam to reply]


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

Date: Fri, 14 Nov 1997 17:27:14 -0500
From: Steven Tolkin <steve.tolkin@fmr.com>
Subject: Multi-line substitution (adding newlines and global replace)
Message-Id: <346CD042.869@fmr.com>

I am having a hard time figuring out how to do a global replace that
adds newlines, but not in front of an existing newline.  
I slurp the whole file into one string.  Details in the code below.
The program can be used as its own test data to demonstrate the problem.

Thanks,
Steve 

#!/usr/local/bin/perl -w
# $Id: testmls.pl,v 1.2 1997/11/14 21:55:50 sy71046 Exp $
# Written by Steven Tolkin 11/14/97
# testmls.pl -- Test multi-line substitution.
# Usage: testmls.pl file  # e.g. testmls.pl testmls.pl to use test data
below

# I want to slurp up a file into one string, and then have each
# sentence start on its own line.
# I want to add a newline at the end of each sentence, but not if the
sentence
# (possibly followed by whitespace) already ends just before a newline.

undef $/;
$_ = <>;

# Remove the non-data lines, so this file can be used for testing
s/^.*?[#;_].*?\n//gmso;

# This next pattern fails.
# It adds a newline after a sentences ends with two spaces then a
newline.
# I think it is because when there are two spaces afterwards
# there is one to satisfy the " +" and the other satisfies the
# negative lookahead.  How can I consume all the trailing
# whitespace if there is no \n and still not add an extra \n?
# (The output should preserve any trailing whitespace from the input.)
# Do I need to use an if test to check for the newline and
# process it by "nibbling" off that piece of the string into another?
# My real program has a more complex pattern, which requires that the
first
# character of the line is a letter, e.g. something like:
# s/^[^\W\d_].*?\. +(?!\n)/$\n/gmso

s/(\. +)(?!\n)/$1\n/g;

# This fails in a different way:
#s/(\. +)(?! +\n)/$1\n/g;

print;

__END__
The period in 1.2 should not end a sentence.  This sentence started on
one
line but ended on another, and has one space after the period.
Should not add an extra newline after this line.
The problem is that we do, but should not,
add a newline after this sentence, which has two spaces after the
period.
The end of the test data is here.

-- 
Steven Tolkin          steve.tolkin@fmr.com      617-563-0516 
Fidelity Investments   82 Devonshire St. R27C    Boston MA 02109
There is nothing so practical as a good theory.  Remarks are mine.


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

Date: Fri, 14 Nov 1997 17:45:15 -0500
From: Steven Tolkin <steve.tolkin@fmr.com>
Subject: Re: Multi-line substitution (adding newlines and global replace)
Message-Id: <346CD47B.1FCE@fmr.com>

Steven Tolkin wrote (and now I am replying to myself.
Sort of like talking to oneself, but in cyberspace no one can hear you
scream.)
 
OK, I get it.  I need two negative assertions in a row: the first 
to force any trailing space to be consumed.  So for the
simple test case the pattern is:

s/(\. +)(?! )(?!\n)/$1\n/g;

Now I'll try to get the real one, considerably more complex, working.

-- 
Steven Tolkin          steve.tolkin@fmr.com      617-563-0516 
Fidelity Investments   82 Devonshire St. R27C    Boston MA 02109
There is nothing so practical as a good theory.  Remarks are mine.


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

Date: Fri, 14 Nov 1997 22:01:22 GMT
From: albertl@internorth.com (A Lee)
Subject: Newbie Q: Skipping lines in output
Message-Id: <346cc9d3.22319972@news.internorth.com>


Hi, 

I'm writing a simple traceroute program, and I was wondering how to
skip the first line of the traceroute output where it output's

	traceroute to <host> <ip>...

before it starts with the actual trace data.  How do I go about doing
this?

Thanks,
Albert


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

Date: Fri, 14 Nov 1997 17:23:49 -0500
From: Rick Silterra <Enrico.Silterra@nortel.com>
Subject: numeric format, commas, etc, like picture
Message-Id: <346CCF75.D2A7A902@nortel.com>

Are there any modules or code that deal with
printing values with comma's in the right place,
according to locale, using the right currency symbol?
Thanks
Rick Silterra


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

Date: Fri, 14 Nov 1997 15:58:44 -0500
From: "Tarik Alkasab" <talkasab@opal.tufts.edu>
Subject: Perl Javascript Interpreter
Message-Id: <64ie52$dk3$1@news3.tufts.edu>

Is there a perl-controllable implementation of Javascript extant?
Obviously, there would be some issues involved in the specific browser
objects, but is there a module to allow a perl-written browser to grok
Javascript?

Terry




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

Date: Fri, 14 Nov 1997 17:28:21 -0500
From: Rick Smith <rsmith@nac.net>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Perl/SQL help
Message-Id: <346CD085.855C218A@nac.net>

sqsh and sybase c-client libraries

brian d foy wrote:

> In article <64fbe8$cnq$1@bandit.cyberwar.com>, Aegis <aegis@outland.cyberwar.com> wrote:
>
> >This is a simple question, more of a 'where can I get'.
> >
> >I am trying to access a Windows NT SQL server via a
> > unix system. Are there perl routines that can do this?
>
> CPAN [1] has all sorts of goodies including database interface modules.
>
> [1]
> Comprehensive Perl Archive Network
> find one near you at <URL:http://www.perl.com>
>
> --
> brian d foy                                  <comdog@computerdog.com>
> NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Don't go with a spineless ISP;                   Rick Smith
        we have more backbone."                   rsmith@nac.net

(201) 983-0725     net @ccess corporation     (201) 983-0453 Fax
                     http://www.nac.net

Quake!                  games@nac.net                      MUDs!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




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

Date: Fri, 14 Nov 1997 13:36:45 -0600
From: Ernest Mueller <ernestm@towery.com>
Subject: Taint checking problem - insecure PATH
Message-Id: <346CA84D.20FF7DE6@towery.com>

OK, we have a CGI Perl script with tainting enabled, which when run from the
command line works fine.  When run from the Web server it gives us the "insecure
$env{path} while running with -t switch at..." error.  However, it appears that
the PATH is set just fine.

I have another CGI that just prints out the environment, and it indicates the
standard PATH.  In the offending CGI, if I do this:

#!/usr/bin/perl -T

print $ENV{PATH};

$ENV{PATH} = "/usr/sbin:/usr/bsd:/sbin:/usr/bin:/etc:/usr/etc:/usr/bin/X11:";

It prints "/usr/sbin:/usr/bsd:/sbin:/usr/bin:/etc:/usr/etc:/usr/bin/X11:", the
standard PATH, even before it gets set.  For some reason it does not believe the
PATH is set unless I set it manually, even though printing it eeasily indicates
that it's fine.

Does anyone have a suggestion?  I'd rather not define spurious PATHs in every
CGI I write.

Ernest
-- 
Ernest C. Mueller                                ernestm@towery.com
Webmaster                                        Phone: (901) 251-7000
Towery Publishing                                http://www.towery.com


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

Date: Fri, 14 Nov 1997 15:58:37 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Taint checking problem - insecure PATH
Message-Id: <comdog-ya02408000R1411971558370001@news.panix.com>

In article <346CA84D.20FF7DE6@towery.com>, Ernest Mueller <ernestm@towery.com> wrote:

>I have another CGI that just prints out the environment, and it indicates the
>standard PATH.  In the offending CGI, if I do this:
>
>#!/usr/bin/perl -T
>
>print $ENV{PATH};
>
>$ENV{PATH} = "/usr/sbin:/usr/bsd:/sbin:/usr/bin:/etc:/usr/etc:/usr/bin/X11:";

do you really need all those paths for a CGI script?  i recommend

   $ENV{'PATH'} = '';

then using explicit paths if you need to (but why would you be doing that
anyway?).

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 14 Nov 1997 15:26:26 -0600
From: Ernest Mueller <ernestm@towery.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Taint checking problem - insecure PATH
Message-Id: <346CC202.24C20F90@towery.com>

brian d foy wrote:
> Ernest Mueller wrote:

> >In the offending CGI, if I do this:

> >#!/usr/bin/perl -T
> >print $ENV{PATH};
> >$ENV{PATH} = "/usr/sbin:/usr/bsd:/sbin:/usr/bin:/etc:/usr/etc:/usr/bin/X11:";

> do you really need all those paths for a CGI script?  i recommend
> 
>    $ENV{'PATH'} = '';
> 
> then using explicit paths if you need to (but why would you be doing that
> anyway?).

I don't really need all those PATHs, that's just the default PATH on my system. 
My point is that the PATH is *already* set by the system to "/usr/bin...", and
that can be proven by printing it out in the script.  However, for some reason
tainting is making me define the path explicitly in the script, at least when I
run it as a CGI (running it from the command line generates no such problem).

Certainly this isn't behaving as designed.  I could fix it by declaring a PATH
in each of my hundreds of CGI scripts I'm changing over to taint checking, but
I'd rather not.

Ernest
[posted and mailed]
-- 
Ernest C. Mueller                                ernestm@towery.com
Webmaster                                        Phone: (901) 251-7000
Towery Publishing                                http://www.towery.com


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

Date: Fri, 14 Nov 1997 13:27:29 -0800
From: Douglas Nichols <dnichols@fhcrc.org>
Subject: Trying to copy a file on winnt in perl...
Message-Id: <Pine.WNT.3.96.971114132511.161A-100000@pc19675.fhcrc>

This seems silly but I'm not finding a command to copy a file from one
place to the next. I could just read it but I'd rather have someother
routine do the dirty.

If you know would you direct me?

thanks

dn

Douglas Nichols                                           dnichols@fhcrc.org
----------------------------------------------------------------------------
Database Manager                            National Wilms Tumor Study Group
Fred Hutchinson Cancer Research Center



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

Date: 14 Nov 1997 21:41:38 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Trying to copy a file on winnt in perl...
Message-Id: <64igii$r7b@news-central.tiac.net>

In article <Pine.WNT.3.96.971114132511.161A-100000@pc19675.fhcrc>,
Douglas Nichols  <dnichols@fhcrc.org> wrote:
>This seems silly but I'm not finding a command to copy a file from one
>place to the next. I could just read it but I'd rather have someother
>routine do the dirty.

If your perl comes with the File::Copy module module then you might be
able to use that:

NAME
       File::Copy - Copy files or filehandles

SYNOPSIS
               use File::Copy;

               copy("file1","file2");
               copy("Copy.pm",\*STDOUT);'
               move("/dev1/fileA","/dev2/fileB");

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Fri, 14 Nov 1997 20:42:43 GMT
From: internetworks1@juno(nospam).com
Subject: WANTED:simple Perl CGI script
Message-Id: <346cb73d.24574927@news.erols.com>

I'm looking for a simple Perl CGI script that will display on a web
page who is logged on to a site at any given time.  I don't want a
counter per se. When a person leaves the domain the numer should
reflect this and if no one is logged on , this should also be
reflected. Any ideas would be appreciated
B. Zubee
internetWORKS, Ltd
internetworks1@juno.com



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

Date: Fri, 14 Nov 1997 16:07:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: WANTED:simple Perl CGI script
Message-Id: <comdog-ya02408000R1411971607580001@news.panix.com>

In article <346cb73d.24574927@news.erols.com>, internetworks1@juno(nospam).com wrote:

>I'm looking for a simple Perl CGI script that will display on a web
>page who is logged on to a site at any given time.  I don't want a
>counter per se. When a person leaves the domain the numer should
>reflect this and if no one is logged on , this should also be
>reflected. Any ideas would be appreciated


   #!/usr/bin/perl -wT

   #check the refresh syntax
   print <<"HTTP";
   Content-type: text/plain
   Refresh: 5;http://somewhere...

   HTTP

   my $data = `/bin/who`;

   print "No one is on\n" unless $data;

   print $data;

   __END__

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
fondly remembers finger


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

Date: 14 Nov 1997 20:48:41 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: what's wrong in my simple module?
Message-Id: <64idf9$r2l$1@news.rwth-aachen.de>

Please,

i have read man and tried also the template from perlfaq7, but 
still can't get my module to work (only the last function works):

Here's file EED.pm:
###################

package EED;
require Exporter;
@ISA = Exporter;
@EXPORT = qw (eed_header, eed_abstract, eed_footer);

sub eed_header
{
    print 'EED_HEADER';
}

sub eed_abstract
{
    return 'EED_ABSTRACT';
}

sub eed_footer
{
    return 'EED_FOOTER';
}

1;

Here's the script eed.pl:
#########################

#!/usr/bin/perl -T
use lib '/home/cris';
use EED;

print eed_header (), "\n";
print eed_abstract (), "\n";
print eed_footer (), "\n";

What i get is:
##############
EED_FOOTER

What's wrong? Thanks in advance!

/Alex                              

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

Date: 14 Nov 1997 13:27:01 -0700
From: lnewton@berio.phx.mcd.mot.com (Lynn D. Newton)
Subject: xemacs comint support for perl shell?
Message-Id: <cn1yb2r6x2i.fsf@berio.phx.mcd.mot.com>


Has anyone written any Emacs lisp code (preferably for
XEmacs), perhaps using the comint command interpreter
wrapper, to run Perl with a -d switch like a shell
interpreter?

Yes, I'm sure I could just start a shell and run perl
-d. I was looking to some prebaked code with a little
polish to it.

=======================
Lynn D. Newton
Motorola Computer Group
Tempe, AZ
=======================


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

Date: Fri, 14 Nov 97 21:33:13 GMT
From: Joshua Pincus <froboz@cif.rochester.edu>
Subject: xforms problems
Message-Id: <1997Nov14.213313.24871@galileo.cc.rochester.edu>

Hello,

I am having a SLEW of Xform4Perl problems.  I have Perl 5.004_01 running 
on my SunOS 4.1.3_U1 SPARC machine.  I compiled Perl (and all of the 
source that I download) with gcc 2.7.2.2 using the stock Sun 
linker and assembler.  

Whenever I try to run an Xforms Perl script, Perl dies with a BUS 
error.  As far as I can tell, the error is in the dynamic-loading 
process.  I added -ldl to the ld line in the linking stage when the 
shared modules are created.  It didn't help.  This seems to only 
happen with Xforms4Perl.  None of the other dynamically loaded 
packages give me the slightest problem.  

Here is a sample:

> perl -d timer.pl 
Signal BUS at timer.pl line 6
        main::BEGIN() called at
/usr/dax/lib/perl5/sun4-sunos/5.00401/DynaLoader.pm line 0
        eval {...} called at
/usr/dax/lib/perl5/sun4-sunos/5.00401/DynaLoader.pm line 0
IOT trap

timer.pl is a perl script that uses the X11::Xforms package.  The script 
dies at the point that the shared module is being loaded.

Is this a Perl 5.004 bug???  Does anyone have any ideas how I might resolve
this problem???

Thanks in advance,
Josh Pincus
-- 
Joshua Pincus
UNIX Programmer
University of Rochester Computing Center
Rochester, New York 14627


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

Date: 14 Nov 1997 20:06:09 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Y2000 Issues in PERL CGI scripts?
Message-Id: <eli$9711141458@qz.little-neck.ny.us>

brian d foy <comdog@computerdog.com> wrote:
> mike@stok.co.uk (Mike Stok) wrote:
> >brian d foy <comdog@computerdog.com> wrote:
> >>i've heard rumors about Perl4 having problems...
> >What rumours and where did you hear them?  

There was a thread about this a few weeks ago. Check for articles
with subject "PERL4 NOT Y2K COMPLAINT?" (yeah, I think it was all
caps) at Dejanews.

> i was talking to Randal in some bar on Tuesday.  he didn't go into
> details but i trust his rumors to be rumors.  i was too busy watching
> the world go by to pay much attention. :)

You weren't the one drinking arbitrary blue drinks.

> brian d foy                                  <comdog@computerdog.com>
> NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>

NY.pm - New York Perl Maniacsaniacsaniacsaniacsaniacsaniacsaniacsaniacsaniacs

> it only happens once per turn.

Yeah, but what's the period? Once per Manhattan?

Elijah
------
NY.pm - New York Perl Mongersongersongersongersongersongersongersongersongers


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

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


Administrivia:

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 1320
**************************************

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