[8005] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1630 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 13 18:17:46 1998

Date: Tue, 13 Jan 98 15:00:31 -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           Tue, 13 Jan 1998     Volume: 8 Number: 1630

Today's topics:
     Re: C-style assert()ions <jay@rgrs.com>
     Re: C-style assert()ions (Andy Lester)
     Re: Can I create a Linked List in Perl (Bart Lateur)
     Re: Can't read beyond ^Z.  Please Help. (Bart Lateur)
     Comparing strings <guage@usa.net>
     Re: Comparing strings <guage@usa.net>
     Re: Comparing strings (brian d foy)
     Re: CPAN packages and makefiles for 5.004 on 95/NT (Chris Searle)
     cram-md5 authentication form IMAP4 in perl. Help ! <Hendrik.Klompmaker@net.iend.wau.nl>
     DBM libraries <sengle1@umbc.edu>
     Re: Examples using select and Open3 or sysread <tegoetz@srv.pacbell.com>
     Re: fastest way for two-dimensional arrays? <zenin@best.com>
     Re: File Upload and CGI.pm 2.36 (Martien Verbruggen)
     Form entry limited to about 1950 characters?  Why? <rlluhman@netins.net>
     Re: Form entry limited to about 1950 characters?  Why? (brian d foy)
     Re: Hello, please look here. jnorman2@usit.net
     Re: help with the following error message (Martien Verbruggen)
     Re: help with the following error message <djboyd@sam.on-net.net>
     Re: hi! help me with cp , plz... <jdporter@min.net>
     Re: How do I convert 19971016085243 to time since the e (brian d foy)
     How to call a function in a .DLL from PERL ? <gerard.legrand@mail.dotcom.fr>
     Re: installing CGI.pm <doug1@weboneinc.com>
     Re: Local paths in Perl for Win32 (Martin Vorlaender)
     Re: Making DynaLoader into a shared library <rra@stanford.edu>
     Re: Module Net::FTP problems <djacobs@tsoft.com>
     Multi-line input: fastest way? (Kevin Reid)
     Newbie: how to get file permissions? <awrobinson@amoco.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 13 Jan 1998 14:53:35 -0500
From: Jay Rogers <jay@rgrs.com>
To: petdance@maxx.mc.net (Andy Lester)
Subject: Re: C-style assert()ions
Message-Id: <82yb0k881s.fsf@shell2.shore.net>

petdance@maxx.mc.net (Andy Lester) writes:
> After having been bitten the other night by mixing up an instance method
> and a class method, I'd like to do some C-style assertions.  For instance,
> say I have this:
> 
> package Foo;
> 
> sub Bar($) {
>     my $self = shift;
>     ref $self eq "Foo" or die "Didn't pass a Foo";
>     # now I can go on.
>     }
> 
> What I'd really like to do, for brevity's sake, since a long error message
> isn't necessary, is something like:
> 
> sub Bar($) {
>     my $self = shift;
>     assert( ref $self eq "Foo" );
>     }

I use the following all the time as an assert like construct:

    die unless ref $self eq "Foo";

P.S. Asserting that an object belongs to a specfic class, prevents you
and others from inheriting that class.

--
Jay Rogers
jay@rgrs.com


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

Date: 13 Jan 1998 21:11:13 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: C-style assert()ions
Message-Id: <69gl9h$an9$1@usenet11.supernews.com>

: I use the following all the time as an assert like construct:

:     die unless ref $self eq "Foo";

I use that, too, and I just wanted to shorten in.  However, I guess there
really isn't much difference between

  die unless (condition);
and
  assert(condition);
and
  (condition) or die;

xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Tue, 13 Jan 1998 20:57:12 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Can I create a Linked List in Perl
Message-Id: <34bbd4c7.3215419@news.tornado.be>

draggs@hawkeye.idx.com wrote:

>I'm reasonably new to Perl, but am an old C programmer.  I was
>wondering if it was possible to create a c-style linked list and perl.
>If it is, how would I go about doing so?

Who would ever want to use C-style lists? Now if you were to say "LISP
style lists", *then* I would understand.

Use arrays for simple lists. If you want nested lists, use an array
reference as a list item.

	Bart.


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

Date: Tue, 13 Jan 1998 21:19:13 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Can't read beyond ^Z.  Please Help.
Message-Id: <34bcd9df.4519119@news.tornado.be>

lame@clark.net () wrote:

>I'm trying to parse through a binary file and process it using perl.
>Nothing was working and I finally figured out that the program was
>terminating as soon as it encountered a ^Z character in the file.

PC, huh? Try setting the file to binmode as soon as you opened it, like
this:

	open SVGIN, "<test2.svg";
	binmode(SVGIN);

HTH,
Bart.


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

Date: 13 Jan 1998 16:16:23 GMT
From: "Kyle" <guage@usa.net>
Subject: Comparing strings
Message-Id: <01bd203e$c30cd060$47c1d49f@cwkbroka.co.ihc.com>

  Help,
  I kind of new to perl and am trying to compare two strings but when I
use:
if ($string1 == $string2) it doesn't work... it's always true.  I thought
that was legal.
  I've tried /$string1/g == $string2  but there are brackets in $string1
and it keeps saying:
unmatched [] in regexp at .... line ..

Any help would be appreciated.

Thanks,
  Kyle.


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

Date: 13 Jan 1998 16:44:14 GMT
From: "Kyle" <guage@usa.net>
Subject: Re: Comparing strings
Message-Id: <01bd2042$a74529a0$47c1d49f@cwkbroka.co.ihc.com>

Oops... the /$string1/g == $string2 is supposed to be:
/$string1/g =~ $string2

Kyle <guage@usa.net> wrote in article
<01bd203e$c30cd060$47c1d49f@cwkbroka.co.ihc.com>...
>   Help,
>   I kind of new to perl and am trying to compare two strings but when I
> use:
> if ($string1 == $string2) it doesn't work... it's always true.  I thought
> that was legal.
>   I've tried /$string1/g == $string2  but there are brackets in $string1
> and it keeps saying:
> unmatched [] in regexp at .... line ..
> 
> Any help would be appreciated.
> 
> Thanks,
>   Kyle.
> 


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

Date: Tue, 13 Jan 1998 17:17:46 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Comparing strings
Message-Id: <comdog-ya02408000R1301981717460001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bd2042$a74529a0$47c1d49f@cwkbroka.co.ihc.com>, "Kyle" <guage@usa.net> posted:

>Oops... the /$string1/g == $string2 is supposed to be:
>/$string1/g =~ $string2

what does that do?  did you mean

   $string_2 =~ m/\Q$string_1\E/g;

or some variant of that?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 13 Jan 1998 19:53:15 GMT
From: chris_ns@searle1.demon.co.uk (Chris Searle)
Subject: Re: CPAN packages and makefiles for 5.004 on 95/NT
Message-Id: <34bbc49d.3234300@news.demon.co.uk>

On 13 Jan 1998 17:56:53 GMT, gsar@engin.umich.edu (Gurusamy Sarathy)
wrote:

[snip]

>Don't use Borland make.  Use the dmake that comes with bindist04.

OK, changed the Config.pm for dmake and yes, excellent, it does work
:-)

Thanks for that.

>Are you sure nmake also fails?  I do this routinely, and it doesn't
>fail for me.

I'm currently suspicious of my nmake, have tried it on some very
standard makefiles this evening, with odd results.

>This is fixed in the DosGlob that comes with 5.004_04.

OK. Leads me to ask if/where the FAQ/known bug list is for this?

Chris Searle
chris@searle1.demon.co.uk


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

Date: Tue, 13 Jan 1998 23:28:31 +0100
From: Hendrik Klompmaker <Hendrik.Klompmaker@net.iend.wau.nl>
Subject: cram-md5 authentication form IMAP4 in perl. Help !
Message-Id: <34BBEA8E.3A648A9D@net.iend.wau.nl>

Hi,

I'm new to perl programming so there might be something I'm doing
completly wrong.
Anyway, in a webmail application (in perl) I try to include CRAM-MD5
authentication for IMAP4 (as described in rfc 2095). Somehow the results
don't match and I hope someone in this group can help me with it.

Here is the code. As you can see the final result is not what it should
be according to the rfc 2095 example.
Thanks in advance for your advice.

Bye

Hendrik

#!/usr/local/bin/perl
use MD5;
require '/home/webmail/base64.pl';

$challange = "
PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+";
$challange = &base64'b64decode( $challange );
print "decoded challange =$challange\n";
$password = "tanstaaftanstaaf";
$step1 = $password;
#ipad and opad according to keyed-md5
#http://snad.ncsl.nist.gov/itg/doc/draft-ietf-ipsec-ah-hmac-md5-01.txt
#
$ipad = "\x36";$ipad x=64; #ipad is a string of 64 times char(0x36)
$opad = "\x5c";$opad x=64; #opad is a string of 64 times char(0x5c)
##################################################################
#the cram-md5 formula according to rfc2095
# md5(($password xor $opad), md5(($password xor $ipad), $challange))
# 1) append null's to password to 64byte length
# 2) or xor password (from 1) with ipad
# 3) append challange to the result of step 2
# 4) apply md5 to result of step 3
# 5) xor password (from step 1) with opad
# 6) append md5 result from step 4 to the 64byte result from step 5
# 7) apply md5 on the rsult of step 6
#
##################################################################
#step 1
#padd password with null to length 64
$step1 = pack "a64" , $password;
##################################################################
#step2
#
$step2 = $step1^$ipad; #xor
##################################################################
#step3
$step3 = $step2.$challange;       #append the challange from server
#
##################################################################
#step4
$step4 = &md5($step3);         # apply md5 to that
#
##################################################################
#step5
$step5 = $step1^$opad; #xor
#
##################################################################
#step6
$step6 = $step5.$step4;    #append the md5 result from step 4
#
##################################################################
#step7
$step7 = &md5($step6);         #apply a md5
#
##################################################################
print "Expected :b913a602c7eda7a495b4e6e7334d3890\n";
print "Result   :$step7\n";

sub md5 {
  local ($md5in);
  $md5in = $_[0];
  my $md5 = new MD5;
  $md5->add($md5in);
  $digest = $md5->digest();
  $md5str = unpack("H*", $digest);
  return $md5str;
}


--
-----------------------------------------------------------------
|************** Wageningen Agricultural University. ************|
|  Department of Information Management and Datacommunication   |
-----------------------------------------------------------------
Hendrik Klompmaker: Senior Technologist
Internet          : Hendrik.Klompmaker@Net.IenD.Wau.Nl
X400              : c=nl;a=400net;p=surf;o=wau;ou1=IenD
                  : ou2=Net;s=klompmaker;gi=hendrik
Phone             : +31 (0)317-484059
Fax               : +31 (0)317-482970
Snail             : Dreijenplein 2
                    6703 HB Wageningen / The Netherlands
--------------------------------------------------------




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

Date: Tue, 13 Jan 1998 17:04:04 -0500
From: englehart scott <sengle1@umbc.edu>
Subject: DBM libraries
Message-Id: <34BBE4D4.41C6@umbc.edu>

I'm writing scripts for a cgi-bin on my ISP's server. When I run the
scripts on the server command line I get the message:

perl: using incompatible library '/lib/libm.so.4.5.26'
        Desire minor version >= 6 and found 5

The script does run, though. It also runs when called from the web. The
first line of my scripts is #!/usr/bin/perl. When I change it to
#!/usr/bin/perl5.003, the script still runs from the command line, but
not when called from the web. 

This has been an interesting quirk up to now. I just started writing a
script that uses dbmopen(). The script runs fine from the command line,
but when it runs from the web, it won't access the files I created when
I ran it from the command line.

When I run the script from the command line dbmopen() uses the exact
file name I give it as a parameter. When I the script from the web it
creates two new files; one with the file name and .dir appended, and the
other with .pag appended.

I'm assuming that somehow the script is using different versions of perl
and/or libraries depending on whether it's running from the command line
or the web. My ISP's server uses UNIX and I think it is apache. There
appears to be several versions of perl in several different directories
on the server. Have any ideas what exactly is going on and how I, or my
ISP can fix it?

Thanks,
Scott


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

Date: Tue, 13 Jan 1998 14:15:20 -0800
From: Thomas Goetze <tegoetz@srv.pacbell.com>
Subject: Re: Examples using select and Open3 or sysread
Message-Id: <34BBE778.167EB0E7@srv.pacbell.com>

Here is a first crack at answering my own question:

Thomas Goetze wrote:
> 
> Does anyone have any working code that gives examples about
> how to use the (4 argument) select along with open3 and
> sysread to correctly handle any (or most) situations that could occur
> when running a system command?
> 

First here is a dummy program that writes to both STDOUT, STDERR
and requires a read from STDIN--I called it out_n_err

---------------------------------------
#!/usr/local/bin/perl
 
print STDOUT "First line to stdout.\n";
print STDOUT "Second line to stdout.\n";
print STDERR "First line to stderr.\n";
while(<STDIN>) {
    print "From STDIN: ",$_;
}
print STDOUT "Third line to stdout.\n";

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

Next here is the code that correctly handles reading from STDOUT,
STDERR and can even write to STDIN along the way. Of course,
there are some obvious ways to clean this up, and the decisions
about handling the ready filehandles will vary with each
application. But this is a start--hope it is useful for someone.

The main problem I had was in discovering that
vec($foo, 1, 1) = 0 does NOT really "undo"
vec($foo, 1, 1) = 1. I think it has to do with whether
$foo is a string or a number, but in any case it was rather
confusing--so I went with the $filehandles_open counter
intead.

-----------------------------------------
use FileHandle;
use IPC::Open3;
 
$read_size = 16384;
$in = new FileHandle;
$out = new FileHandle;
$err = new FileHandle;
$cmd = '/usr/local/bin/perl out_n_err';
 
$pid = open3($in, $out, $err, $cmd);
die "open3 failed.\n" unless ($pid);
$rin = $win = $ein = '';
vec($rin, $out->fileno(), 1) = 1; #Set the bit corresponding to reading
from $out on
vec($rin, $err->fileno(), 1) = 1; #Set the bit corresponding to reading
from $err on
vec($win, $in->fileno(), 1) = 1; #Set the bit corresponding to writing
to $in
$ein = $rin | $win; #This turns on exception conditions for all file
desriptors that we're interested in 
$filehandles_open = 3; #required for proper exiting of the endless loop
 
while ($filehandles_open) { 
    $nfound = select($rout=$rin, $wout = $win, $eout = $ein, undef);
    #The above select returns true for those filehandles that are at EOF
but have
    #not been closed. $nfound will be number of ready filehandles or -1
on error.
 
    #Check the return code of $nfound
    if ($nfound == -1) {
        #If we get here then we should handle exceptional condidtions
        die "Exceptional condition encountered--exiting.\n";
    }
 
    #Check to see if $err has anything to read
    if (vec($rout, $err->fileno(), 1)) {
        #Then $err is ready for reading
        $e_read = sysread $err, $error_string, $read_size,
length($error_string); #append to $error_string
        die "sysread error from error.\n" unless defined($e_read);
#sysread returns undef on error
        if ($e_read == 0) { #indicates filehandle is at EOF
            vec($rin, $err->fileno(), 1) = 0; #turn off this bit, so we
don't check for it anymore
            vec($ein, $err->fileno(), 1) = 0; #turn off this bit, so we
don't check for it anymore
            $err->close(); #close it because it's at EOF, and after
changing bit
            $filehandles_open-- if ($filehandles_open); #don't go below
zero
        }
    } 
   #Check to see if $out has anything to read
    if (vec($rout, $out->fileno(), 1)) {
        #Then $out is ready for reading
        $o_read = sysread $out, $out_string, $read_size,
length($out_string);
        die "sysread error from out.\n" unless defined($o_read);
        if ($o_read == 0) { #indicates filehandle is at EOF
            vec($rin, $out->fileno(), 1) = 0; #turn off this bit, so we
don't check for it anymore
            vec($ein, $out->fileno(), 1) = 0; #turn off this bit, so we
don't check for it anymore
            $out->close(); #close it because it's at EOF
            $filehandles_open-- if ($filehandles_open); #don't go below
zero
        }
    }
    #Check to see if $in is waiting to read
    if (vec($wout, $in->fileno(), 1)) {
        $in_string = "This is the string that is being input to
STDIN.\n";
        $i_write = syswrite $in, $in_string,  length($in_string);
        die "syswrite error to in\n" unless defined($i_write);
        vec($win, $in->fileno(), 1) = 0; #turn off this bit, so we don't
check for it anymore
        vec($ein, $in->fileno(), 1) = 0; #turn off this bit, so we don't
check for it anymore
        $in->close(); #we'll only write once--and then close it
        $filehandles_open-- if ($filehandles_open); #don't go below zero
    }
}
 
print STDOUT "Processing was successful.\n";
print STDOUT "Error was:\n$error_string\n";
print STDOUT "Stdout was:\n$out_string\n";
 
---------------------------------------
Any questions or comments are welcome,

Tom Goetze
tegoetz@pacbell.com


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

Date: 13 Jan 1998 21:30:29 GMT
From: Zenin <zenin@best.com>
Subject: Re: fastest way for two-dimensional arrays?
Message-Id: <884727276.176887@thrush.omix.com>

Bernhard Freund <0542760043-0003@t-online.de> wrote:
: What is the fastest way to create and access 
: something comparable to a two-dimensional array?
: (Some lines of code would help me getting used to the syntax...)

	man perldsc
	man perllol
	man perlref

: How can get C-subroutines in my perl programs?

	man perlxstut
	man perlxs

	Hope this helps!

-- 
-Zenin
 zenin@best.com


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

Date: 13 Jan 1998 22:10:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: File Upload and CGI.pm 2.36
Message-Id: <69gont$13$1@comdyn.comdyn.com.au>

[Posted & Mailed]

In article <34BB2636.9C7BAA4B@ebc.ericsson.se>,
	Carlos de Sousa <Carlos.de_Sousa@ebc.ericsson.se> writes:
> This is a multi-part message in MIME format.

Please don't do this. Use plain text.

> Is it really so that this will only work with a Netscape 2 browser?

Netscape 2 and up.

> What to do about the SYSOPEN call, could I replace it for something
> else available on Solaris 2? fopen ?

this would be sysopen, in lower case. It's a standard perl function,
at least on unixish systems. Since you're on Solaris, you should have
it. In fact, i am on Solaris, and my perl has it.

> The Perl release I have currently is 5.001  patchlevel 1m

That's your problem. Upgrade. The latest release is 5.004_04. Don't be
fooled by the seemingly low difference in number. There is a really
big difference between the two.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Tue, 13 Jan 1998 15:29:39 -0600
From: "Rick" <rlluhman@netins.net>
Subject: Form entry limited to about 1950 characters?  Why?
Message-Id: <69gm6r$dcq$1@news.iastate.edu>

The following sub supplied as an addition to the Novell Webserver appears to
limit the form to 1950 characters.  If I enter more than 1950 characters I
get the message  "Your comment was not added.  Not all the information was
filled in".  Any suggestions to overcome this limitation?

sub add_comment
{ my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime(time);
  my $retstr;
  if ($name && $email && $comment) {
    $comment = tohtml($comment);
    if (open(FILE, ">>$topicpath")) {
      print FILE "<b>Comment:</b> <a href=\"mailto:$email\">$name</a> ($mday
$month[$mon] \'$year, $hour:$min:$sec)<br>\r\n";
      print FILE "$comment<br><br>\r\n\r\n";
      close(FILE);
      $retstr .= &get_topic;
    } else {
        $retstr .= "<b>Error!</b> $! <br>Your comment could not be added to
$stitle.\n";
    }
  } else {
    $retstr .= "<b>Sorry!</b><br>Your comment was not added.  Not all the
information was filled in.</p>\n";
    $retstr .= comment_form($comment);
  }
  return $retstr;
} # end of add_comment()

sub comment_form
{ my $retstr;
  my $comment = shift;
  $retstr .= "<form method=get action=\"$scriptalias\">\n";
  $retstr .= "<input type=hidden name=ROOT value=$root>\n";
  $retstr .= "<input type=hidden name=FORUM value=$forum>\n";
  $retstr .= "<input type=hidden name=TOPIC value=$topic>\n";
  $retstr .= "<input type=hidden name=NEW value=$flgcomment>\n";
  $retstr .= "<b>New Comment:</b><font size=-2><i>Enter a comment to be
added to this thread (must be less than 1950 characters)</i></font><br>\n";
  $retstr .= "<textarea rows=10 cols=50 name=COMMENT
wrap>$comment</textarea></p>\n";
  $retstr .= "<b>Name:</b><input type=text name=NAME value=\"$name\"
size=22>\n";
  $retstr .= "<b>Email:</b><input type=text name=EMAIL value=\"$email\"
size=22></p>\n";
  $retstr .= "<input type=submit value=Submit> <input type=reset
value=Reset>\n";
  $retstr .= "</form>\n";
  return $retstr;
} # end of comment_form()





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

Date: Tue, 13 Jan 1998 17:15:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Form entry limited to about 1950 characters?  Why?
Message-Id: <comdog-ya02408000R1301981715380001@news.panix.com>
Keywords: from just another new york perl hacker

In article <69gm6r$dcq$1@news.iastate.edu>, "Rick" <rlluhman@netins.net> posted:

>The following sub supplied as an addition to the Novell Webserver appears to
>limit the form to 1950 characters.  If I enter more than 1950 characters I
>get the message  "Your comment was not added.  Not all the information was
>filled in".  Any suggestions to overcome this limitation?

CGI questions should be asked in comp.infosystems.www.authoring.cgi.

you may also want to read the documents in the CGI Meta FAQ.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 13 Jan 1998 20:10:30 GMT
From: jnorman2@usit.net
Subject: Re: Hello, please look here.
Message-Id: <34bbca1e.158468380@nntp.usit.net>

Mr@Long.com wrote:

>**********************************************************
>*  This Article was Posted By Newsgroup AutoPoster 95!!  *
>* The worlds most effective Auto Poster to Newsgroups!!! *
>*              Download your own copy from:              *
>*                  http://151.196.69.173                 *
>**********************************************************
>if you wanna have a longer, larger, thicker penis, a harder erection, 
>a more powerful ejaculation and to "last" longer, please enter here
>
>http://www.freeyellow.com/members2/longhard/index.html
>
>for more info.
>
>**Note: this is not a porno site, there are no pornographic materials here, 
>             just some useful information.



The abilities of PERL continue to amaze me.


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

Date: 13 Jan 1998 22:13:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help with the following error message
Message-Id: <69gotd$13$2@comdyn.comdyn.com.au>

[As far as I can see, this has nothing to do with modules, 
Newsgroups line adapted]

In article <34BB9622.653646AD@sam.on-net.net>,
	"David J. Boyd" <djboyd@sam.on-net.net> writes:
> I get the following error message:
>       Cannot create a file when that file already exists.
> 
> From the following code seqment:
>   $FirstProcessObj->Wait(INFINITE) || &ProcessError("WAIT");
>   $FirstProcessObj->GetExitCode($ExitCode) || warn
> &ProcessError("GetExitCode");
>   &RptError ("Exit code for Process wait is: $ExitCode");

This is not complete runneable code. I have no clue what package
you're using. Please submit a *full* program that is as short as
possible, and that demonstrates the problem.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Tue, 13 Jan 1998 17:13:07 -0500
From: "David J. Boyd" <djboyd@sam.on-net.net>
To: Eli the Bearded <*@qz.to>
Subject: Re: help with the following error message
Message-Id: <34BBE6F3.92FE3FD7@sam.on-net.net>

here is the part that creates the process

program is the location of perl and arg_1 can be what you want it to
be.  For me it
is running another perl script.

  Win32::Process::Create(
    $FirstProcessObj,
    $program,
    $arg_1,
    0,
    CREATE_NEW_CONSOLE,
    ".") || warn &RptError("DRIVER.PL: WARNING - Cannot create First
process\n    $!");

  $FirstProcessObj->SetPriorityClass (HIGH_PRIORITY_CLASS) || warn
&RptError("DRIVER.PL: WARNING - Unable to set priority of first process
- $!");


Eli the Bearded wrote:

> David J. Boyd <djboyd@sam.on-net.net> wrote:
> > I get the following error message:
> >       Cannot create a file when that file already exists.
> >
> > From the following code seqment:
> >   $FirstProcessObj->Wait(INFINITE) || &ProcessError("WAIT");
> >   $FirstProcessObj->GetExitCode($ExitCode) || warn
> > &ProcessError("GetExitCode");
> >   &RptError ("Exit code for Process wait is: $ExitCode");
> >
> > What does it mean?



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

Date: Tue, 13 Jan 1998 15:48:14 -0500
From: John Porter <jdporter@min.net>
Subject: Re: hi! help me with cp , plz...
Message-Id: <34BBD30E.59FB@min.net>

Alexander Kovalenko wrote:
> 
> hi guyz! I ran in strange problem.. ;(
> My program is the following:
> $directory='/'+$name+'/';
> system ("cp /main/*.*",$directory);
> 
> but for some reasons it does not want to copy all filez from main
> directory to a new one... I know that this is basic and that I should
> read some FAQ , but I do not have that much time... so if ya know how to
> do it..., plz let me know! Thanx a lot!

I hope that while you're waiting for the braindump from everyone on
c.l.p.m, you're reading the documentation.  rtfm before rtffaq.

First, the string concatenation operator is not + (plus), it's . (dot).
	$directory = '/'.$name.'/';
Then, you might find it cleaner to interpolate $name into a double-
quoted string:
	$directory = "/$name/";
Then, and this is hardly obvious, system(), like exec(), does not simply
concat its arguments and pass them to a shell.  If there is more than
one arg (as in your example), they are passed as is (after variable
interpolation) to the execvp() system call; this call expects the first 
argument to be an executable file. Clearly, the "cp /main/*.*" in your 
example is not. It also means there is no shell, so no fileglob
expansion
takes place: "/main/*.*" is treated literally -- not what you meant. You 
want the form of system() which takes exactly one arg, a complete
command. 
This command is passed to a shell for execution; fileglobs will
(typically)
get expanded for you. So you can say this:

	system( "cp /main/*.* $directory" );

Or, if you don't need that temporary variable:

	system( "cp /main/*.* /$name/" );

If you had trouble with this, I expect we'll be hearing from you again
soon, and often...

John Porter
jporter@logicon.com

system() (and exec)


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

Date: Tue, 13 Jan 1998 16:35:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How do I convert 19971016085243 to time since the epoch??
Message-Id: <comdog-ya02408000R1301981635000001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bd2057$f7289f00$48a30193@lonw3633>, "Toby Ounsted" <tkounste@bechtel.com> posted:

>specifies the date that an event occoured, i.e. Year=1997, Month = 10th,
>Day =16th, time was 08:52:43 AM.  What I would like to do is to convert
>this string into the number of seconds since the epoch

use the Date modules which you find on CPAN [1].

[1] 
Comprehensive Perl Archive Network
find one near you at <URL:http://www.perl.com>

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 13 Jan 1998 21:29:54 +0100
From: Gerard Legrand <gerard.legrand@mail.dotcom.fr>
Subject: How to call a function in a .DLL from PERL ?
Message-Id: <34BBCEC2.80E44321@mail.dotcom.fr>

Hi!
To resume my problem: How to Call function in .DLL from a PERL Script?

Here is my problem:
* I have a DLL with a function to call in a web application on my HTTP
server
* The function parameters types are typedef structure whitch ar passed
by address.
* i must get these structure and use it in My Perl script to show the
result

example:
* I have a function:
  Swap(STRUCT_Vector &a,STRUCT_Vector &b) as long
  The function swap the values of a and b in memory and the struct of *
STRUCT_Vector is :
struct STRUCT_Vector {
long x;
long y;
STRUCT_Vector &next;
}

how to declare a PERL structure that can be passed to my functions and
how to call these functions ?
So :
How to query My DLL in PERL ? (If possible, if not :-((((  help me with
whatever you want... )

thnx in advance
Girard



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

Date: Tue, 13 Jan 1998 17:29:03 -0500
From: Douglas Clifton <doug1@weboneinc.com>
Subject: Re: installing CGI.pm
Message-Id: <34BBEAAF.5D5A81F0@weboneinc.com>

Bryan Murtha wrote:

> Hello,
>     I am trying to install the CGI-modules-2.75.tar.gz CGI library by
> Licoln Stein. I was wondering if anyone could answer why my programs are
> not compiling? I have unpacked the library in the same directory as Perl
> 5, and yet it still gives me an error whenever I try to compile my
> program telling me that it can't find this library. I'm on a Sun 5.51
> machine and I can't install it properly.
> Thank you ,
> Bryan Murtha

Hell, I just put CGI.pm in the same directory as my CGI scripts and it
worked fine.

If it is in a direcory other than what @INC points to you can always do a:

use lib '/path/to/the/directory';

--
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer

===================
Web One Inc.
Website Development
Phone: 888-699-WEB1
Phone: 616-552-9999
Fax:   616-552-9920
sales@weboneinc.com
www.weboneinc.com
===================



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

Date: Tue, 13 Jan 1998 20:10:25 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Local paths in Perl for Win32
Message-Id: <34bbbc21.524144494f47414741@radiogaga.harz.de>

GarryG (newspost@dyna_cs.demon.co.uk) wrote:

: I have a real painful problem when writing perl scripts.
: When I run them from a comamnd prompt to test them, I have to reference the
: data directory from the current directory the script is run from.
: but when I run the script through the web browser the current directory is
: cgi-bin,

: Is this an oddity with perl or perl for win32, or should I look at the way
: my server is setup?

It's the MicroCrap server.

A possible solution is to use the FindBin module (in the standard
distribution) to chdir to your perl script's directory.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 13 Jan 1998 12:12:27 -0800
From: Russ Allbery <rra@stanford.edu>
To: toml@synnet.com
Subject: Re: Making DynaLoader into a shared library
Message-Id: <m3k9c4w2tw.fsf@windlord.Stanford.EDU>

[ Posted and mailed. ]

toml <toml@synnet.com> writes:

> 	I have been trying to make the Dynaloader so
> 	we can placed it into a shared library (libperl.so)
> 	Is this possible? I have been able to follow
> 	the instructions to make a shared libperl.so. That
> 	works fine. What we are trying to do is write
> 	a C program which calls perl which calls C.

You don't need to have Dynaloader as a separate shared library to do that.
What you *do* need to do, however, is link your program against DynaLoader
directly (in other words, include .../<arch>/auto/DynaLoader/DynaLoader.a
in the link line before any other library, including libperl.so).

To see a full software package that has this working, if you're having
trouble, go to ftp.insync.net and download inn-1.7.2.insync-1.1d.tar.gz
from /pub/inn.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 13 Jan 98 21:58:52 GMT
From: Doug Jacobs <djacobs@tsoft.com>
Subject: Re: Module Net::FTP problems
Message-Id: <34bbe39c.0@news.tsoft.net>

Bruce Cook <BC3-AU@bigfoot.com> wrote:

> [bruce@cletus develop]$ ./get-maillist.pl 
> Can't locate auto/Net/FTP/net.al in @INC at ./get-maillist.pl line 14
> [bruce@cletus develop]$ 

It sounds like you didn't install the module properly, or, it's not in
a path Perl knows about (that's what @INC is).

See the installation instructions at your nearest CPAN on how to
install modules (or just go to www.perl.com.)


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

Date: Tue, 13 Jan 1998 15:10:22 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Multi-line input: fastest way?
Message-Id: <1d2sung.5r59bi1igems8N@slip166-72-108-123.ny.us.ibm.net>

Is there a better way to implement line continuations?

  $U_prompt = eval(qq|"$U_config{prompt}"|); 
  print $U_prompt, "> ";                     # display prompt
  chomp($U_code = <STDIN>);                  # get line
  while ($U_code =~ /\\$/) {                 # if backslashed...
    chop $U_code;                            # remove backslash
    print " " x length($U_prompt), "> ";     # print cont. prompt
    chomp($U_code .= "\n".<STDIN>);          # append string
  }


-- 
Kevin Reid


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

Date: Tue, 13 Jan 1998 16:46:32 -0600
From: "Andrew W. Robinson" <awrobinson@amoco.com>
Subject: Newbie: how to get file permissions?
Message-Id: <34BBEEC8.7C028214@amoco.com>

How do I get the permission of a file, especially in a format 
suitable to use with the chmod() function? 

The mode field of the stat() function looks close. The perlfunc 
page defines mode as "type and permissions", but I don't know how 
to separate the two. Is there a simple octal formula to do so?

Thanks!

Andrew Robinson
-- 
Offshore Business Unit           email: awrobinson@amoco.com
Amoco Corporation                      phone: (504) 586-6888
New Orleans, LA                          fax: (504) 586-2637
-----
The events depicted herein are fictional. Any similarity to 
persons living or dead is entirely...oops, wrong disclaimer


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

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

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