[8496] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2113 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 16 23:08:52 1998

Date: Mon, 16 Mar 98 20:00:38 -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           Mon, 16 Mar 1998     Volume: 8 Number: 2113

Today's topics:
        A matter of timing (Daniel)
        adding time? (jay)
    Re: Dictionary? <jefpin@bergen.org>
    Re: elsif question <rjk@coos.dartmouth.edu>
    Re: Exotic-Looking Microbes Turn Up In Ancient Antarcti (Ilya Zakharevich)
        find.pl ?? <hongy@panther.cs.ucla.edu>
    Re: fixed length files <uri@sysarch.com>
    Re: fixed length files (Mike Stok)
    Re: fixed length files <rjk@coos.dartmouth.edu>
    Re: fixed length files (Andrew M. Langmead)
        Help with regx extracting URLS from HTML pages, plese. Chad
    Re: how to slice an anonymous hash? <danboo@negia.net>
        HTTP 1.1 (Densin Roy.)
    Re: Illegal octal digit error? (Martin Vorlaender)
    Re: Is there a "Newsgroup" for Newbies to Perl? <chasecreek.systemhouse@usa.net>
    Re: Is there a "Newsgroup" for Newbies to Perl? <stackhou@execpc.com>
    Re: Is there a "Newsgroup" for Newbies to Perl? (I R A Aggie)
    Re: Multiple substitues <rjk@coos.dartmouth.edu>
        Need help with PERL programming <masroor@bga.com>
        NONNULL Constraints with SWIG dway@mat.net
        Open2 <melling@panix2.panix.com>
        Opening a File <cauleyfj@ix.netcom.com>
    Re: Opening a File <uri@sysarch.com>
    Re: Opening a File <cauleyfj@ix.netcom.com>
    Re: Problem determining if system function worked <chasecreek.systemhouse@usa.net>
        Seattle Perl Group: 3/17 Meeting <Tim.Maher@seaslug.org>
    Re: Statistics for comp.lang.perl.misc <uri@sysarch.com>
    Re: webserver configuration/cgi.pm/nt <chasecreek.systemhouse@usa.net>
    Re: Why this one doesn't work ? <danboo@negia.net>
    Re: Why this one doesn't work ? (Andrew M. Langmead)
        XS programming query (Gordon Stanton)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 17 Mar 1998 03:00:23 GMT
From: rkdious@ix.netcom.com (Daniel)
Subject: A matter of timing
Message-Id: <6ekop3$ktl@dfw-ixnews11.ix.netcom.com>

Hello

I'm trying to find a way to delay my program for less than a second.  The 
sleep() routine will only sleep for whole seconds.  The select() routine 
doesn't seem to function under either WinNT or (don't laugh) Win95.  

Has anyone else had the same problem with delays?

-Daniel


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

Date: Tue, 17 Mar 1998 03:34:04 GMT
From: mocat@spamtrap.best.com (jay)
Subject: adding time?
Message-Id: <350dee8b.352321287@nntp.best.com>

What is the best way to add hours, minutes, or seconds to the time?
I've read the manpages for localtime, Time::localtime, and
Time::Local, and have come up with nothing.

19:43:33 + 30 minutes is 19:73:33... ;)
not exactly what i want...
20:13:33 sounds more like it.. but I cant get perl to do this for
me...

any help appreciated
thanks


-j
:mocat@best.com/www.best.com/~mocat:


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

Date: Mon, 16 Mar 1998 21:35:31 -0500
From: "I have a life, and I can prove it!" <jefpin@bergen.org>
To: Doug Evans <doug@ccinet.com>
Subject: Re: Dictionary?
Message-Id: <Pine.SGI.3.95.980316213423.14586B-100000@vangogh.bergen.org>

>Is there a perl dictionary, somewhwre?

As in a glossary of terms and functions and stuff?  It can be found,
broken into tiny, bitesize pieces in the perldoc program.  Use it to read
faqs, the function list, et. al.

--
| A bird in the hand leaves a nasty stain.
|                                                   - Jeff Pinyan

    Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
             techmaster@bergen.org | techmaster@mindless.com
                qw[jeff] on #perl,#javascript,#cgi on IRC

 &jp('"($``','','$)EDF8```','$*52J4```','$+E1G4```','#J``@','#2__`');sub
jp{for$w(@_){$c=unpack('B48',unpack('u',$w));$c=~tr/10/# /;print "$c\n"}}



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

Date: Mon, 16 Mar 1998 21:44:27 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: elsif question
Message-Id: <350DE38D.89432F5D@coos.dartmouth.edu>

Doug Evans wrote:
> 
> I am using ActiveState, on an NT 4.0 work station. I am all the way up to
> p.16 of "Learning Perl on Win32 Sytems". Why can't I get elsif to work, but
> can make...
> 
> else
> if
> 
> ...work?

I don't know.  What did you try to do that did not work?  Perhaps you could
provide some of your code which tries to use elsif.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 17 Mar 1998 03:22:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Exotic-Looking Microbes Turn Up In Ancient Antarctic Ice
Message-Id: <6ekq8p$dra$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<chris+usenet@netmonger.net>],
who wrote in article <6ekd4l$cq7$1@schenectady.netmonger.net>:
> for(split//,<DATA>){push@@,index$/=$,,$_,};$_x=<_>;
                                            ^
					    +--- why this?

Now I'm puzzled:

  D:\tcpip\bin>perl -we "$_ = index 'a','a',,,,"
  

No warning?!

Ilya



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

Date: 17 Mar 1998 02:57:20 GMT
From: Hong Yuan <hongy@panther.cs.ucla.edu>
Subject: find.pl ??
Message-Id: <6ekoqg$age$1@news.cs.ucla.edu>

How do I tell &find(.) to follow symbolic links as in shell:
find . -follow ...
?

Thx!

Hong.


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

Date: 16 Mar 1998 19:52:42 -0500
From: Uri Guttman <uri@sysarch.com>
To: shawn b mcgowan <shawnb3@ZIPLINK.NET>
Subject: Re: fixed length files
Message-Id: <x7hg4yjfz9.fsf@sysarch.com>

shawn b mcgowan <shawnb3@ZIPLINK.NET> writes:

> I am new to perl as I am sure this question will demonstrate.
> 
> I am trying to pass data to a legacy system that will only read in fixed 
> length data.  I have been able to parse data from a form and write it 
> out to a file but to this point I have not come up with a good way of 
> padding the data.  If anyone could point me in the direction of an 
> answer I would greatly appreciate it.

if you are on unix (which you should be!) use the dd command. it can
block and unblock between fixed and variable length records. i used it
many years ago to transfer 9 track tapes to/from a legacy system.

or you could do it in perl but i leave that as an exercise to the reader
(or you could hire me to do it).

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 years of Perl experience, Available Immediately
uri@sysarch.com              Resume and Sample code at http://www.sysarch.com
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: 17 Mar 1998 01:40:09 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: fixed length files
Message-Id: <6ekk9p$5i0@news-central.tiac.net>

In article <350DBCBC.51AC@ZIPLINK.NET>,
shawn b mcgowan  <shawnb3@ZIPLINK.NET> wrote:
>I am new to perl as I am sure this question will demonstrate.
>
>I am trying to pass data to a legacy system that will only read in fixed 
>length data.  I have been able to parse data from a form and write it 
>out to a file but to this point I have not come up with a good way of 
>padding the data.  If anyone could point me in the direction of an 
>answer I would greatly appreciate it.

Some ways to do it might include:

  pack       (if you want to include binary representations)
  printf     (if you're churning out text)

- the ifs are mot hard & fast guidelines, the documentation in the
perlfunc document which comes wioth recent perl releases should be
consulted to see whether one is more appropriate than the other.

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: Mon, 16 Mar 1998 21:32:30 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: shawn b mcgowan <shawnb3@ZIPLINK.NET>
Subject: Re: fixed length files
Message-Id: <350DE0C0.35EBFFD9@coos.dartmouth.edu>

[posted and mailed]

shawn b mcgowan wrote:
> 
> I am trying to pass data to a legacy system that will only read in fixed
> length data.  I have been able to parse data from a form and write it
> out to a file but to this point I have not come up with a good way of
> padding the data.  If anyone could point me in the direction of an
> answer I would greatly appreciate it.

Either sprintf() or pack() should be able to do what you want.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 17 Mar 1998 02:43:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: fixed length files
Message-Id: <EpxzK3.Fo6@world.std.com>

shawn b mcgowan <shawnb3@ZIPLINK.NET> writes:

>I am trying to pass data to a legacy system that will only read in fixed 
>length data. 

Have you seen this entry in the FAQ? "How can I manipulate
fixed-record-length files?"
<URL:http://www.perl.com/CPAN-local//doc/manual/html/pod/perlfaq5/
How_can_I_manipulate_fixed_recor.html>




-- 
Andrew Langmead


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

Date: 16 Mar 1998 17:09:07 -0800
From: Chad
Subject: Help with regx extracting URLS from HTML pages, plese.
Message-Id: <6ekifj$dod@drn.newsguy.com>


Hi,

I'll make this sort and sweet.  I need help extracting links from HTML
documents, link by link ( line by line, etc ) so I can replace them with a tag
infront of the HREF.

I tried to use LWP and HTML::LinkExtor, i could get it to extract all the links
once it read the whole file, but what I need is this, i guess:

($link,$title) = regx;  I'm not real good with regx so if someone could help I
would really appriciate it.

($link,$title) = *<*href*=*"*LINK*"*>*TITLE*</a>
                   ^        ^
                   |         --- might be here, might not
                   * for white spce.

could someone help, I know I'm retarded.

-chad


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

Date: Mon, 16 Mar 1998 20:27:55 -0500
From: Dan Boorstein <danboo@negia.net>
To: Sanjay Malunjkar <smalunjk@cisco.com>
Subject: Re: how to slice an anonymous hash?
Message-Id: <350DD19B.6FCD6477@negia.net>

Sanjay Malunjkar wrote:
> 
> I am trying to slice an anonymous hash but havent succeeded so far...
[snip]
> $_='F::Scot::L::Tiger::C::Company name';
> @h= @{split(/::/)}{'F','L'};
> print "slice of anonymous hash in h=@h";
> #expect Scot Tiger, instead get blank

i think you want this for line 2:

@h = @{ { split(/::/) } }{'F','L'};

you must create a hash reference first, before you can dereference it.

dan


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

Date: 17 Mar 1998 02:07:13 GMT
From: den@loxinfo.co.th (Densin Roy.)
Subject: HTTP 1.1
Message-Id: <6eklsh$460$1@news.loxinfo.co.th>

	Have any perl sample  with perl module to connect HTTP 1.1 
	(support virtual hosts). If it possible , I want module
	.pl not .pm coz I not system admin that can install it to system.
	
					Thank for advance
					densin Roy.

	P.S. please mail to densin@loxinfo.co.th


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

Date: Tue, 17 Mar 1998 02:25:11 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Illegal octal digit error?
Message-Id: <350dd0f7.524144494f47414741@radiogaga.harz.de>

Stan Horwitz (stan@thunder.temple.edu) wrote:
: Could someone please tell me what an "illegal octal digit" error message
: means in Perl5 on HP Unix? I have a sequence of 12 "if" statements, all of
: which are identical in format. Those 12 statements are: 

:       if ($in_month eq "Jan") {  $trans_month = 01;  }
:       if ($in_month eq "Feb") {  $trans_month = 02;  }
[...]
:       if ($in_month eq "Dec") {  $trans_month = 12;  }

: The statements involving "Aug" and "Sep" get flagged with the following
: error messages:

:   Illegal octal digit at convert.pl line 121, at end of line
:   Illegal octal digit at convert.pl line 122, at end of line

Like in C, a number starting with a '0' is interpreted as octal. In
octal representation, valid digits are 0 thru 7, so 08 and 09 are no
valid octal numbers. Just replace the 0s with blanks, and you'll be set.

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: Tue, 17 Mar 1998 00:56:30 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350DC8E9.C5B3AA42@usa.net>

As I have said before, I don't mind getting flamed if something good comes
of it - and even if it doesn't I don't mind getting flamed.  This isn't
war, it is a place for humans to cuss and discuss :)

I am willing to helpout and take my lumps when I answer wrongly or out of
turn.

And I would like to thank Larry Wall, Lincoln Stein, Jonathan Feinberg,
Martin Vorlaender, Randal Schwartz, Tom Christiansen, Tom Grydeland, Uri
Guttman, and last but not least Abigail (who has always seemed to include
something useful in her .sig; but never her last name :-)

All of them have answered one hair-brained question or another which I
posted and I appreciated it a lot!


Sincerely,
Bill Jones.
FCCJ Webmaster
(aka Sneex :)

Joergen W. Lang wrote:

> But where are they ? Right now the situation seems to be a bit like:
>
> newbie ---void---void---void---void---void--- expert
>

PS - I think of myself in the newbie--void--void area as well; but rapidly
changing that as fast as this group can stand me :)



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

Date: Mon, 16 Mar 1998 18:45:44 -0600
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6ekhbm$mkv@newsops.execpc.com>

All,

Well, I think we've pretty much hashed this one to death
(please no pun jokes).  Since I started this thread I guess
it's up to me to end it.  A lot of good points have been
brought up on both sides of the fence.  My thinking has
changed on a few points that have been brought up.  I don't
think we'll solve the problems here but I know I learned a
great deal the last few days.  Thanks to one and all who
contributed.  I have to agree with Joergen though.  I'm sure
there are many who can assist beginners here.  The experts
shouldn't be expected to shoulder it all.

Maybe Bob and Sneex can come up with something to take some
of the pressure off.  Dave, thanks for the tip on Dejanews. 
That will be my first stop from now on.

Regards,

--
Mark Stackhouse

***********************************************************************

homepage: http://www.execpc.com/~stackhou

"The best things in life aren't things."
--Art Buchwald

***********************************************************************


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

Date: Mon, 16 Mar 1998 20:41:27 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <fl_aggie-1603982041280001@aggie.coaps.fsu.edu>

In article <6ekdmi$a71@acme.sb.west.net>, jbc@west.net (John Callender) wrote:

+ Makes you wonder if we could just solve all this mess without moderation, 
+ but merely by creating a "comp.lang.perl.wizards" group with a charter 
+ stating that it is explicitly intended as a newbie trap, where real 
+ wizards wouldn't be caught dead. And conversely, "comp.lang.perl.newbies" 
+ would be chartered for high-level talk by the perl-porters types.

That's a possibility. There are alt.groups named alt.something.cancel,
which are designed specifically as spam-traps: anything posted there
catches the attention of a cancel-bot, which nukes the post.

That's more extreme than what you're suggesting, but it is an example
of a trap in action.

+ Seriously, though, I'm not sure that the comp.unix.wizards sword cuts both 
+ ways. I mean, I'm not sure that newbies' prediliction for posting in 
+ *.wizards groups necessarily implies that they won't use *.newbies 
+ groups.

They would. It would be a trival thing to killfile anything crossposted
to both, tho, and a number of newbies _would_ crosspost between the
two groups.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: Mon, 16 Mar 1998 22:00:18 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: dfrench@aig.vialink.com
Subject: Re: Multiple substitues
Message-Id: <350DE745.DF5F0BB1@coos.dartmouth.edu>

[posted and mailed]

dfrench@aig.vialink.com wrote:
> 
> I would like to perform multiple substitues on a single line.  For instance
> using "sed" the I can do the following:
> 
> sed -e "s/A/a/g;s/B/b/g;s/C/c/g" filename
> 
> The content of the substitutes above were just an example, but I would like to
> do the same kind of thing in perl.  I would like to do multiple substitues in
> a single command,  somthing like:
> 
> $result = s/A/a/ && s/B/b/ && s/C/c/;
> 
> does anybody know a way to do this?

(There's a huge difference between a 'line' and a 'command'.)

You could do it in perl the same way you do it in sed, with multiple
substitutions on a single line:

s/A/a/g;s/B/b/g;s/C/c/g;


If you try to put them all in one expression, you have to be careful how you
do it.  Using && or 'and', any substitution which does not find a match will
cause later substitutions not to be executed.  Using || or 'or', you'll have
the same problem with any substitution which does find a match.  If you skip
the logical operators and just put them in a list, your result will be either
a list of 1s and null strings, or only the result of the last substitution,
depending on the context.

This is probably the best way to do it:

$result = join('', (s/A/a/g, s/B/b/g, s/C/c/g));

$result will be true (a sequence of 1s) if at least one of the substitutions
matched, and false (the null string) if none of them matched.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 17 Mar 98 03:27:39 GMT
From: masroor <masroor@bga.com>
Subject: Need help with PERL programming
Message-Id: <350dedab.0@feed1.realtime.net>


I am trying to program the following, but having problems to capture a 
specific data. Any help would be appreciated.
The following is the description.

1)Say when you ping a machine from the command line in UNIX you get the
  following.
The command I am using to ping is "ping 10.10.10.10".

OUTPUT below
========================================================
64 bytes from 10.10.10.10: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 10.10.10.10: icmp_seq=1 ttl=255 time=0 ms

2) I would feed the above ping response back to my perl program, and in my
   perl program I need to capture the "icmp_seq=0" information. But I am
   unable to do so.

3) I do the following to redirect the output of the ping to my perl 
script.

  % ping 10.10.10.10 | myprog.pl

4) The contents of myprog.pl is below.

   #!/bin/perl
   print "$ARGV[0]\n" ;

5) The command "ping 10.10.10.10" is a continous command, it should never
   stop. But when I do step #3 , the ping stops and I get no output.

6) Basically my goal is to redirect of the ping output to myprog and 
   process the icmp_seq value, how can I capture the "icmp_seq" value ?

Thanks
Masroor
email masroor@bga.com    



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

Date: Mon, 16 Mar 1998 20:04:04 -0600
From: dway@mat.net
Subject: NONNULL Constraints with SWIG
Message-Id: <6eklj3$jub$1@nnrp1.dejanews.com>



Has anyone out there used constraints much with SWIG?

I'm trying to set things up so that trying to pass a NULL pointer as a
parameter to swigged API functions will be rejected.  (I figure that since
SWIG already does dynamic type checking, it should check for NULL pointers
too, since that's generally a more frequent cause of errors than wrong types.)

Currently, I've got this basically working by using the "constraints" feature
in SWIG.  To do this, I use an %apply directive for all of our 100+
user-defined types (as suggested by the SWIG 1.1 html docs) e.g.:

%apply Pointer NONNULL { Matrix * };
%apply Pointer NONNULL { Vector * };
%apply Pointer NONNULL { List * };
etc.

My two questions are:

1. Is there any simpler way to do this?  Some kind of global way to make all
pointer types have a NONNULL constraint would be cool.  Or is this an
enhancement request for SWIG 2.0?

2. What is the best way to handle exceptions to this rule?  Right now, we've
got a couple of rare cases where a particular function does need to accept a
NULL pointer.  I thought putting a %clear before and an %apply after would
work, such as:

%clear Vector *;
class Thing {
  public:
    // Thing constructor needs to accept a NULL vector on occasion...
    Thing(Vector *aVector);
}
%apply Pointer NONNULL { Vector * };

This doesn't seem to work, though.  Also, the compiler doesn't seem to like it
if I put a %clear in the middle of a class definition.

Any thoughts?  (Feel free to post replies rather than emailing me directly.)

BTW, we're using Tcl as our scripting language (although we're also
considering Python), but I don't think the issue of scripting languange is
relevant to my questions...

Thanks!

- Doug Way
  dway@mat.net

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 16 Mar 1998 20:13:18 -0500
From: Michael Mellinger <melling@panix2.panix.com>
Subject: Open2
Message-Id: <v5c4t0yyv9t.fsf@panix2.panix.com>


I want to open a pipe to a command using IPC::open2 where I can send
each line of my array to a Unix command then read the result.  For example,
I want something like this:

open2($RDR,$WTR,'uniq -c');
 
# Must send everything first.
for ($i=0;$i<$n;$i++){
	print $WTR $foo[$i];
}
while(<$RDR>) {
	print $_;
}

There is something like this on pg 456 of the Camel book.

-Mike

-- 
melling@archonmedia.com
melling@panix.com
http://www.archonmedia.com/antique_forum


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

Date: Mon, 16 Mar 1998 20:42:51 -0500
From: "Frank J. Cauley" <cauleyfj@ix.netcom.com>
Subject: Opening a File
Message-Id: <350DD51B.5A287F57@ix.netcom.com>

I am trying to run the following script:

$file = "../db_sail_html.dat";
$fileout = ">../db_sail_out.dat";
$eventfile = "../db_event.dat";
open (EVENTF, "eventfile") || die " sorry could not open $eventfile $!";
open (HTMLFILE, "$file") || die "sorry, could not open $file $!";
open (OUTFILE, "$fileout") || die "sorry could not generate or find

I am not able to open the first file The error message says that the
file or directory cannot be found. 

When I comment out the first open the following opens work.

I know the file is there because I can see it with Explorer.


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

Date: 16 Mar 1998 21:35:54 -0500
From: Uri Guttman <uri@sysarch.com>
To: "Frank J. Cauley" <cauleyfj@ix.netcom.com>
Subject: Re: Opening a File
Message-Id: <x7btv6jb79.fsf@sysarch.com>

"Frank J. Cauley" <cauleyfj@ix.netcom.com> writes:

this is too easy. like shooting newbies in barrel.

> I am trying to run the following script:
> 
> $file = "../db_sail_html.dat";
> $fileout = ">../db_sail_out.dat";
> $eventfile = "../db_event.dat";
> open (EVENTF, "eventfile") || die " sorry could not open $eventfile $!";
                 ^
missing $ 

> open (HTMLFILE, "$file") || die "sorry, could not open $file $!";
> open (OUTFILE, "$fileout") || die "sorry could not generate or find

since you built the filenames and open modes in vars, you don't need the
"" above. that would have shown you the error directly.
> 
> I am not able to open the first file The error message says that the
> file or directory cannot be found. 
> 
> I know the file is there because I can see it with Explorer.

you shouldn't use explorer. it was made in the evil pits of hell ruled
by uncle bill!

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 years of Perl experience, Available Immediately
uri@sysarch.com              Resume and Sample code at http://www.sysarch.com
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Mon, 16 Mar 1998 22:01:19 -0500
From: "Frank J. Cauley" <cauleyfj@ix.netcom.com>
Subject: Re: Opening a File
Message-Id: <350DE77E.CD8799B8@ix.netcom.com>

I have been looking at this for two days and did not notice the missing
$. Thank you. I promise to ask a more difficult question the next time.

Uri Guttman wrote:
> 
> "Frank J. Cauley" <cauleyfj@ix.netcom.com> writes:
> 
> this is too easy. like shooting newbies in barrel.
> 
> > I am trying to run the following script:
> >
> > $file = "../db_sail_html.dat";
> > $fileout = ">../db_sail_out.dat";
> > $eventfile = "../db_event.dat";
> > open (EVENTF, "eventfile") || die " sorry could not open $eventfile $!";
>                  ^
> missing $
> 
> > open (HTMLFILE, "$file") || die "sorry, could not open $file $!";
> > open (OUTFILE, "$fileout") || die "sorry could not generate or find
> 
> since you built the filenames and open modes in vars, you don't need the
> "" above. that would have shown you the error directly.
> >
> > I am not able to open the first file The error message says that the
> > file or directory cannot be found.
> >
> > I know the file is there because I can see it with Explorer.
> 
> you shouldn't use explorer. it was made in the evil pits of hell ruled
> by uncle bill!
> 
> uri
> 
> --
> Uri Guttman                     SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire  ----  8 years of Perl experience, Available Immediately
> uri@sysarch.com              Resume and Sample code at http://www.sysarch.com
> Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Tue, 17 Mar 1998 01:10:07 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Problem determining if system function worked
Message-Id: <350DCC1B.1027A70C@usa.net>

In answer to your question use -

$result = system('rename ' . $importFileName . ' ' . $archiveFileName) /
256;
# Notice the / by 256...

Then check the $return value...

Also -
[Shamelessly stolen from Mike Stok --
Have you checked out the move routine in File::Copy?  I haven't tried it
on a Microsoft system, but perldoc File::Copy might be a worthwhile kite
to fly.]

HTH,
Sneex :)

Russ Conway wrote:

> I'm having trouble determining if this system() called worked.
>
> $result = system('rename ' . $importFileName . ' ' . $archiveFileName);
>
> $result seems to always equal 0. How can I determine if the rename was
> successful? Is there a better way to do this than system()? I'm running
> this script under Windows NT.
>
> TIA





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

Date: Mon, 16 Mar 1998 18:09:05 +0000
From: Tim Maher <Tim.Maher@seaslug.org>
Subject: Seattle Perl Group: 3/17 Meeting
Message-Id: <350D6AC1.5B950906@seaslug.org>

FINAL REMINDER: Seattle Perl User's Group Meeting 3/17/98

             Topics: ``Plans for Perl User's Group; Overview of PERL''
               Time: March 17th 1998 (Third Tuesday) at 7pm
              Place: Loyal Heights Community Center
                     2101 NW 77th St.
                     Seattle, WA 98117
               Cost: Free
               Info: http://www.halcyon.com/yumpy/spug
             Leader: Tim Maher, (206) 781-UNIX

WHY ATTEND?

This being the first ever meeting, you'll have a good chance to make
your hopes and desires for the group known, with a good chance of actually
influencing the course of its development.

Secondly, there will be a presentation on the Perl language, which should
help those who haven't used it much yet understand what all the fuss is
about.

Thirdly, unless a sufficient number of people show up to indicate an
adequate community interest in the group, we just might not end up
having one!

Fourthly, because it's St. Patrick's Day, we'll have a stronger than
usual incentive to engage in some elbow-bending at one of the nearby
Irish pubs afterwards.

So, if you want to learn more about Perl, help others learn more about
Perl, and interact with others in the Perl community, please help us
get this group off to a successful start!


DRIVING TIPS:

If you're coming from I-5, you could take the NW 85th St. exit, head West
until you reach 15th Ave. NW., turn left (South) onto that, then right
(West) onto 77th St. NW.  The Community Center is a few blocks down at
21st Ave. NW, with plenty of street parking.

Those coming from parts further South or from downtown could follow
Elliott St. until it becomes 15th Ave. NW, and, heading North, turn
onto 77th St., etc.  (If you don't know how to get onto Elliott St.,
then just go to the NW 85th St. exit.)

Once you get to the Community Center, head on up to the second floor,
where we will be in one of the large meeting rooms (#2 or #4).

NO SEAJUG CONFLICT

Despite what you would gather from the SPUG and SEAJUG listings being
listed together in the PI's Tech Datebook section for Tuesday, SEAJUG
actually meets on Wednesday, so Java interest is not a good excuse to
miss the SPUG meeting!

SEE YOU THERE!

I'll be the red-headed, red-bearded guy all decked out in green!

====================================================================
|  Tim Maher, Ph.D.             Tel/Fax: (206)781-UNIX             |
|  SPUG Founder                 Email: spug@timji.seaslug.org      |
|  Seattle Perl Users Group:    http://www.halcyon.com/yumpy/spug  |
====================================================================




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

Date: 16 Mar 1998 21:09:15 -0500
From: Uri Guttman <uri@sysarch.com>
To: sneaker@earthling.net
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <x7en02jcfo.fsf@sysarch.com>

Sneex <chasecreek.systemhouse@usa.net> writes:

> Do I win?
> 
> :)
> 
> Greg Bacon wrote:
> 
> >          (kb)   (kb)  (kb)  (kb)
> > Posts  Volume (  hdr/ body/ orig)  Address
> > -----  --------------------------  -------
> >
> >    58   105.7 ( 46.9/ 58.8/ 30.7)  sneaker@earthling.net
> >
> >   (kb)   (kb)  (kb)  (kb)
> > Volume (  hdr/ body/ orig)  Posts  Address
> > --------------------------  -----  -------
> >
> >  105.7 ( 46.9/ 58.8/ 30.7)     58  sneaker@earthling.net
> >
> > Articles  Address
> > --------  -------
> >
> >        9  sneaker@earthling.net

yes, a smelly pair of sneakers!

uri

-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 years of Perl experience, Available Immediately
uri@sysarch.com              Resume and Sample code at http://www.sysarch.com
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


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

Date: Tue, 17 Mar 1998 01:25:20 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: webserver configuration/cgi.pm/nt
Message-Id: <350DCFAB.812CBE40@usa.net>

OK!  Dig out an OLD post on me, huh?  :)

Anyways, I would do the standard debugging stuff for CGI's -  1)  use print
header; NEAR the beginning of the script; 2) use diagnostics; to see about getting
errors generally displayed in the broswer output; and 3) Post errors log info with
posted question and some example code showing how to replicate the error :-)

HTH,
Sneex :-)

anne_lee@mailexcite.com wrote:

> backup a little bit, I am currently having problem using CGI.pm (or just
> calling CGI) - forget about the cgi-lib.  I have a script that works on
> command line using CGI.pm, but does not work my EMWAC webserver (got a 404).
> If I comment out use CGI; (and other lines that use CGI.pm) it will work.
> CGI.pm is under my c:\perl\lib and other cgi.pm's .pm are under
> c:\perl\lib\cgi.  In c:\perl\lib, I also has cwd.pm, which I used in my script
> and works via browser.
>
> Any idea?
>
> In article <34fc7041.8621882@news.alt.net>,
>   someguy@knick-knack.com (Curtis) wrote:
> >
> > Using Sarathay's Win32 port I had many problems with scripts that used
> cgi-lib.
> > I sat down with the perldocs and learned to use CGI.pm and all of my
> problems
> > went away. Not sure what the problem was, but cgi-lib seems to be the root
> of
> > it...
> >
> > --Curtis
> >
> > On Tue, 03 Mar 1998 15:57:11 GMT, Bill Jones
> <webmaster@fccjmail.fccj.cc.fl.us>
> > wrote:
> >
> > >See!  I told you I was wrong before :-)
> > >
> > >Anyways, sometimes you just have to rewrite code...
> > >
> > >Sorry :-(
> > >
> > >
> > >
> > >anne_lee@mailexcite.com wrote:
> > >
> > >> NT SP 3 did not solve the problem
> > >> The script was written for cgi-lib.pl under unix, I am porting it to NT
> by
> > >> trying to do as little change as possible and narrow down the problem by
> doing
> > >> simple task.
> > >>
> > >> In article <34F78276.1226EB25@fccjmail.fccj.cc.fl.us>,
> > >>   bill@astro.fccj.cc.fl.us wrote:
> > >> >
> > >> > Service Pack 3 is available and highly recommended.
> > >> > Why are you mimicing cgi-lib functionality?
> > >> >
> > >> > CGI.pm allows html output, headers and all.
> > >> >
> > >> > I say the problem is - service Pack 3 required...
> > >> > (I've been wrong before :-)
> > >> >
> > >> > HTH,
> > >> > Bill
> > >>
> > >> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> > >> http://www.dejanews.com/   Now offering spam-free web-based newsreading
> > >
> > >
> >
> >
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading





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

Date: Mon, 16 Mar 1998 19:59:41 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Why this one doesn't work ?
Message-Id: <350DCAFD.4B166CF9@negia.net>

indhiraa@hotmail.com wrote:
> #!/bin/sh
> # this line will be comment for PERL \
> exec perl "$0" $@"
> 
> print "hello..\n";
> 
> My intention is to avoid hard-coding the path to the Perl interpreter.
> but this script continuously execs and never goes beyond that.

your first line is the problem. that line is special to the shell as
well as perl. just as your shell will pass the script along to the
specified interpreter, so will perl. so you end up in a loop:

'sh' execs 'perl' <------------------------------
'perl' runs $0                                  |
'perl' sees #! and  passes control back to 'sh'--

makes for an interesting looping construct. :)

dan


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

Date: Tue, 17 Mar 1998 02:50:39 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Why this one doesn't work ?
Message-Id: <EpxzwG.J8p@world.std.com>

indhiraa@hotmail.com writes:

>My intention is to avoid hard-coding the path to the Perl interpreter.
>but this script continuously execs and never goes beyond that.

The perlrun man pages suggests the following for systems that don't
honor the "#!" line. You should be able to adapt it to your purposes.

                   #!/usr/bin/perl
                   eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
                           if $running_under_some_shell;

It also contains an explanation on how it works.
-- 
Andrew Langmead


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

Date: 17 Mar 1998 11:19:34 +1000
From: gee@stc.nepean.uws.edu.au (Gordon Stanton)
Subject: XS programming query
Message-Id: <gee.890096839@stc>
Keywords: Curses,XS,XSUB,perl,C

Hi,
	I am trying to add a delscreen function to the Curses module. All
delscreen needs is a SCREEN pointer. newterm seems to return this so I should
be able to pass this to a XS function that calls the C function delscreen.
	The problem is that it doesn't work. I can't even make it crash inside
the function. It is getting to the function because the c_exactargs is being
called, you can check this by supplying 2 arguments to delscreen on the perl
side instead of one. I have put delscreen in Curses.pm in the EXPORT array
next to newterm. 
	Anyways, here's and extract of the C code.

XS(XS_Curses_delscreen)
{
    dXSARGS;
#ifdef C_DELSCREEN
    c_exactargs("delscreen", items, 1);
    {
        int ttttt;
        Screen scr;

                ttttt = 10 / 0;	/* should die here due to divide by zero */
                scr = c_sv2Screen(ST(0),0);

        delscreen(scr);
    }
#else
    c_not_there("delscreen");
#endif
    XSRETURN(1);
}

							Gordon
		Anti spam addresses
email : gee
	@
	stc.
	nepean.
	uws.
	edu.
	au

work: gordon.stanton
	@
	qmi.
	com.
	au



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

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

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