[10385] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3978 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 14 23:07:25 1998

Date: Wed, 14 Oct 98 20:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 14 Oct 1998     Volume: 8 Number: 3978

Today's topics:
    Re: Are there any "perl.newbie" group or forum? <rra@stanford.edu>
    Re: Are there any "perl.newbie" group or forum? (Larry Wall)
        Arrays of UDTs? How to do this? buckybeaver73@yahoo.com
    Re: Arrays of UDTs? How to do this? (Mark-Jason Dominus)
    Re: Arrays of UDTs? How to do this? (Martien Verbruggen)
    Re: Creating an unreadable perl executable <zenin@bawdycaste.org>
    Re: Don't kill me (Ronald J Kimball)
    Re: Don't kill me (David Adler)
        Embedding Perl into C mdefreitas@sikorsky.com
        FREE UNIX TELNET ACCESS <gmcmillan@iname.com>
        Generating a blessed reference outside of 'new' Chris_Schoenfeld@sonic.net
    Re: Help! Structures in Perl (Abigail)
    Re: Help! Structures in Perl <huckfin@hotmail.com>
    Re: Help! Structures in Perl (brian d foy)
        help! trying to emulate server side includes... (minus the SPAMSUCKS) (Chris Stanley)
    Re: Help! (Ronald J Kimball)
    Re: How do you use the perl compiler? <gmcmillan@iname.com>
    Re: How do you use the perl compiler? (Martien Verbruggen)
    Re: how to remove trailing spaces? (Abigail)
        Implementing 'union's in Perl to C extensions (Helena Jeeves)
    Re: NET::FTP problem (Richard Nolet)
        New book on Perl <tedken@manning.com>
        Perl FAQ - error found in "#How_do_I_get_a_file_s_times <ludlow@us.ibm.com>
    Re: splitting on meta chars (Sam Holden)
    Re: struggling with a regex... HEeeeelp! (Ronald J Kimball)
        Win32::OLE and Netscape <fbesnier@home.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 14 Oct 1998 19:10:49 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <ylr9wamv6e.fsf@windlord.stanford.edu>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> Russ Allbery wrote:

>> On the other hand, students are going to graduate and then have to find
>> jobs in the real world.  Furthermore, students want to do cool projects
>> and want to be able to read existing code, and some classes require use
>> of libraries that are written by regular programmers.  Because of that,
>> there's a great deal of pressure on CS programs to teach in "practical"
>> languages, meaning languages actually used in the world.  Which mostly
>> translates to C, with smatterings of C++ and Java.

> How very true. Colleges are becoming more like corporations and as they
> start charging more and more for tutition, they must turn out happy
> satisfied s/students/customers. Perl is used in the real world though.
> There were several classes offered in Perl at the university I used to
> work at.

You tend to find more Perl the less emphasis the CS department as a whole
has on theoretical compiler design and the like.  Academics tend not to
like Perl very much for all of the sloppy, unconstrained reasons that one
may expect.

For example, we seem to have a great deal of difficulty actually managing
to keep a Perl class going here.  This probably has something to do with
the fact that we have one of the most theory-oriented CS departments
anywhere.

> Java is more restricted and doesn't give you the kind of rope Perl does,
> but after a bit too much C++, Java just didn't appeal, Perl is fun and
> is so easy at a certain level. But I see your point.

The main thing that I detest about Java is the naming convention.  Apart
from that, it does fix a few problems that C++ has, and it does move away
from "manage your own memory."

Which is, in and of itself, an interesting quandry for teaching computer
science.  I definitely believe that students need to be exposed to memory
management and programming in languages that don't do that for you, if for
no other reason than the fact that *someone* has to write memory managers.

The way we do that here is to teach classes where the assignments must be
completed in C but every submitted solution must also run completely clean
under Purify, including no leaked memory (even potentially).

> Hmm...true, maybe the campaign for Perl should include getting CS
> Chairmen to consider offering more Perl classes in their undergraduate
> curricula. This would increase awareness, usage after graduation and
> perhaps less 'clueless newbies'. Food for thought.

My experience is that most programming in a CS cirriculum isn't learned
from the programming classes.  It's learned from the classes in other
subjects that require you to write programs.  I learned more C and C++
from my operating system design and network programming classes than I
learned from any programming classes.

-- 
#!/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: 14 Oct 1998 19:46:27 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <703nm3$o19@kiev.wall.org>

In article <702itf$fm3$1@nnrp1.dejanews.com>,  <droby@copyright.com> wrote:
>Since he seems to poke his head in a bit lately, I'm hoping to hear some
>commentary from Larry on this question.  Might be quote-file fodder.

You want quote fodder?  Yow.  If there's anything worse than being
turned out to pasture, it's being turned *into* pasture.

Lessee.  Fodder, fodder, fodder...

Perl should only be studied as a second language.  A good first
language would be English.

Don't teach Perl as a first language.  Instead, find a nice small
language and teach the subset of Perl that corresponds to it.

The trouble with teaching Perl as a first computer language is that your
students won't appreciate it till they start learning their second.

The trouble with teaching Perl as a second language is that there's
no single suitable first language to go in front.

Don't teach them Perl as a first language, or they'll never make it to
their second language...

Don't let anyone tell you what your first computer language should be
before you've learned several.

Perl can certainly be used as a first computer language, but it was
really designed to be a *last* computer language.

Well of *course* Perl should not be taught to everyone.  It should only
be taught to people who want to like their computers.

Honk if you love Perl! (or strawberries!)

Larry


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

Date: Thu, 15 Oct 1998 01:47:27 GMT
From: buckybeaver73@yahoo.com
Subject: Arrays of UDTs? How to do this?
Message-Id: <703k7f$2ei$1@nnrp1.dejanews.com>

   Hi all... I am attempting something like this:

$smonths = ("Jan|31 Feb|28 Mar|31 Apr|30 May|31 Jun|30 Jul|31 Aug|31 Sep|31
Oct|31 Nov|30 Dec|31");

$cnt = 1;
@temp1 = split(/ /, $smonths);
foreach $i (@temp1) {
#print "$i<br>\n";
        ($mname, $numdays) = split(/\|/, $i);
        $montharray = {
                name => $mname,
                days => $numdays
        };
        push $montharray, @mmontharray;
# for testing... print the name of the month just added...
print $montharray[$cnt]=>name, "<br>\n";
        $cnt++;
}

But it doesn't seem to work... What I want is an array indexed by the month #,
with a name field of the month name, and a days field consisting of the # of
days in that month. Can anyone see what I am doing wrong? I am fairly new to
PERL and this problem is running me in circles. Any help is appreciated.

Thanks,
Justin


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


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

Date: 14 Oct 1998 22:16:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Arrays of UDTs? How to do this?
Message-Id: <703lto$d80$1@monet.op.net>

In article <703k7f$2ei$1@nnrp1.dejanews.com>,  <buckybeaver73@yahoo.com> wrote:
>        push $montharray, @mmontharray;

This is the big problem; you have the arumgnts to `push' in the wrong
order.  Should be

	push @montharray, $montharray;

>print $montharray[$cnt]=>name, "<br>\n";

	print $montharray[$cnt]{name}, "<br>\n";

See http://www.plover.com/~mjd/perl/FAQs/References.html for a short
guide to reference syntax.


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

Date: Thu, 15 Oct 1998 02:26:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Arrays of UDTs? How to do this?
Message-Id: <q3dV1.97$AA3.205673@nsw.nnrp.telstra.net>

In article <703k7f$2ei$1@nnrp1.dejanews.com>,
	buckybeaver73@yahoo.com writes:

I am not going to ask you why in heaven's name you would want to do this.

>         push $montharray, @mmontharray;

The order is wrong.

# perldoc -f push
=item push ARRAY,LIST

See why? You should really consult the documentation now and again.

If you do this right, you have an array of has references. You could
have a look at perllol and perldsc to see if you are accessing the
elements the right way.

# perldoc perldata
# perldoc perlref
# perldoc perldsc
# perldoc perllol

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd.       | why kamikaze pilots wore helmets - Dave
NSW, Australia                      | Edison 


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

Date: 15 Oct 1998 01:34:24 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Creating an unreadable perl executable
Message-Id: <908415260.453808@thrush.omix.com>

Abigail <abigail@fnx.com> wrote:
: Zenin (zenin@bawdycaste.org) wrote on MDCCCLXX September MCMXCIII in
: <URL:news:908324517.643137@thrush.omix.com>:
: ++ 
: ++ 	Another option is putting the file on a filesystem mounted read
: ++ 	only so that even root can't change the flags, however root
: ++ 	could still remount the filesystem.  Even a read only medium
: ++ 	such as a CDROM won't work as it could simply be mounted as
: ++ 	a union file system, or if that isn't supported it could read
: ++ 	the raw device.
:
:
: NFS mount it, with flags set that root has no write permission on
: the mounted device. Of course, root on the box that has the disk
: still can change the permissions....

	Also you have the problem that non-readable executables over
	NFS are still unsecure, simply because the client still can
	always do the read indirectly. -If it couldn't, the client
	could never get the server's file into local memory.

	Even past that, there is always local /dev/kmem... :-/
-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 14 Oct 1998 22:03:58 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Don't kill me
Message-Id: <1dgwr6o.10wifqitpd5fkN@bos-ip-2-161.ziplink.net>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:

> Yes, I meant 72...only about 50 people emailed me regarding this typo.

I think you mean 52 people.

HTH, HAND

-- 
 _ / '  _      /         - 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: 15 Oct 1998 02:58:49 GMT
From: dha@panix.com (David Adler)
Subject: Re: Don't kill me
Message-Id: <703od9$1at@news1.panix.com>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:

>Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
>
>> Yes, I meant 72...only about 50 people emailed me regarding this typo.
>
>I think you mean 52 people.
>
>HTH, HAND

Oooooohhhh you're evil!

:-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
TINC, fnord, tinc.


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

Date: Thu, 15 Oct 1998 02:29:27 GMT
From: mdefreitas@sikorsky.com
Subject: Embedding Perl into C
Message-Id: <703mm7$683$1@nnrp1.dejanews.com>

I have embedded the perl interpreter into my C++ program.
I also have a user written extension to perl that I have
written (using the XS utility) which gets dynamically
loaded. Thus my program looks like:

   PerlInterpreter *my_perl = perl_alloc();
   perl_construct(my_perl);

   int argc = 3;
   char *argv[] = {"", "-MMyExtension", "script_name"};

   perl_parse(my_perl, xs_init, argc, argv, env);
   perl_run(my_perl);

   perl_destruct(my_perl);
   perl_free(my_perl);

The xs_init function was set up to load the DynaLoader and
my extension.

This works... but only the first time.  When I go through a
second pass of this code, perl complains when my script
uses any function in my user extension.  It gives the error:

  Undefined subroutine &main::my_func called during global destruction

It looks like my extension is not getting loaded the second time.

If I do not use the -MMyModule switch in the perl_parse function,
but instead say "use MyModule;" in my script itself, it ALWAYS WORKS!

I do not want my users to specify the "use MyModule" directive in
all their scripts... I want it to be loaded by default.

What am I doing wrong?

I do not have constant access to the web, so please email me at:
mdefreitas@sikorsky.com

Thanks for any help...

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


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

Date: Wed, 14 Oct 1998 20:42:17 -0400
From: "Graham McMillan" <gmcmillan@iname.com>
Subject: FREE UNIX TELNET ACCESS
Message-Id: <703ggh$h01@enews2.newsguy.com>

Does anyone now of any good (fast if possible) unix servers that offer
telnet access for free?  If so please e-mail me or post a response.






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

Date: Thu, 15 Oct 1998 01:34:26 GMT
From: Chris_Schoenfeld@sonic.net
Subject: Generating a blessed reference outside of 'new'
Message-Id: <703jf3$13m$1@nnrp1.dejanews.com>

I have a package with a new() routine which creates a new blessed reference
and returns it.

The package also has a dbconnect() method.

The dbconnect method reads:

sub dbconnect{
    my $self = shift || new(); #create a new object if none passed.

  #make db connection...  return $self; } This way I can create a new
unconnected object with new() or go all the way and get a connected object
with dbconnect().

This doesn't work though - although new() sets up and blesses the object when
called this way exactly as it does when it is called externally (as verified
by 'print Dumper $blessedref' just before return), the object is not assigned
to $self.

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


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

Date: 15 Oct 1998 02:03:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Help! Structures in Perl
Message-Id: <703l4v$kec$1@client3.news.psi.net>

Will (wcoarseyREMOVETHIS@gate.net) wrote on MDCCCLXX September MCMXCIII
in <URL:news:7037j0$1a18$1@news.gate.net>:
++ Is it possible to have structures in Perl like in C?

Yes. You can do it with hashes. Or objects. Or even closures.

++ Next I want and array of these structures like this:

Then you take an array of hashrefs. Or an array of objects. Or closures.

++ If an array of structures are possible, then how would I access individual
++ element? I C I would do something like this:

        print map {"Name = $_->{name}\n"} @items [0 .. 4];
        
Or in about 100 different ways.

++ I've just started using Perl and have not quiet got the hang of Perl's data
++ structures.


Perhaps you should start reading the documentation. There's a lot
of very good documentation shipped with Perl.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Wed, 14 Oct 1998 22:36:55 -0400
From: "Will" <huckfin@hotmail.com>
Subject: Re: Help! Structures in Perl
Message-Id: <703mvs$276q$1@news.gate.net>

:what a novel idea! we should have this in perl! BTW this is not an array
:of address structs, but an empty pointer to one.


Why the sarcasm? I'm obviously new to perl, I have several books that I'm
trying to work through, but my problems can't wait. So I posted a question
to this group with the hopes of some help.
:

:  W>      for (i=0; i<5; i++){
:  W>          printf("Name = %s\n", items[i].name);
:  W>      }
:really! i would never have know how to do that before this post! data
:structures in C were very difficult for me. :-)


Sorry my C examples bore you! I was trying to communicate in a language that
I know. These example are just that! It's too much to ask for a simple
answer. Maybe when I know it all I can be as clever as you.

BTW, i'm still RTMF.


-- Will





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

Date: Wed, 14 Oct 1998 22:54:09 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help! Structures in Perl
Message-Id: <comdog-ya02408000R1410982254090001@news.panix.com>

In article <703mvs$276q$1@news.gate.net>, "Will" <huckfin@hotmail.com> posted:


> Why the sarcasm? I'm obviously new to perl, I have several books that I'm
> trying to work through, but my problems can't wait.

everyone thinks that their problems can't wait.

-- 
brian d foy                                  <comdog@computerdog.com>


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

Date: Thu, 15 Oct 1998 02:28:59 GMT
From: cstanley@SPAMSUCKSusit.net (minus the SPAMSUCKS) (Chris Stanley)
Subject: help! trying to emulate server side includes...
Message-Id: <36255b66.6367114@news.usit.net>

be kind, i'm new.  :)

i am running a script that parses and displays html pages.  the only
problem is, it doesn't emulate server side includes which i use
heavily.  i'm assuming i need to do a s/PATTERN/REPLACEMENT/gie type
operation, but i can't get the pattern quite right and i'm not sure
the easiest way to include the whole indicated file as the
replacement.  so basically, i need a pattern that will find:

<!--#include virtual="FILENAME" -->

and replace it with the contents of FILENAME.  any assistance would be
greatly appreciated.  thanks!

--
chris stanley
cstanley@SPAMSUCKSusit.net (minus the SPAMSUCKS)



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

Date: Wed, 14 Oct 1998 22:04:01 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Help!
Message-Id: <1dgws2j.u04zt6slxhtsN@bos-ip-2-161.ziplink.net>

_cim_ <cim@online.ee> wrote:

> I use this:
> 
> ($final = $INPUT{update}) =~ s!</P>.*!!s;
> 
> to get all text up to the point when </P> appears.
> 
> I need it to check if </P> is among the 300 first chars. and if not
> then only get all text up to char number 300.

$pos = index $INPUT{update}, '</P>';
$pos = 300 if $pos < 0 or $pos > 300;
$final = substr $INPUT{update}, 0, $pos;

This has the advantage of only taking the first 300 characters if '</P>'
is not present in the string at all.

-- 
 _ / '  _      /         - 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: Wed, 14 Oct 1998 20:45:24 -0400
From: "Graham McMillan" <gmcmillan@iname.com>
Subject: Re: How do you use the perl compiler?
Message-Id: <703gmb$h49@enews2.newsguy.com>

PERL HAS NO COMPILER!!!!
in unix at the prompt type:

prompt% pathtocgi/perlfile.pl

then it will run.




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

Date: Thu, 15 Oct 1998 02:20:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do you use the perl compiler?
Message-Id: <EZcV1.96$AA3.205673@nsw.nnrp.telstra.net>

In article <703gmb$h49@enews2.newsguy.com>,
	"Graham McMillan" <gmcmillan@iname.com> writes:

I didn't see the original posts, just this one, but:

> PERL HAS NO COMPILER!!!!

Don't shout. And perl does have a compiler. perl is a compiler.
5.005_02 comes with an experimental perlcc, which also tries to
compile into an executable, via a translation into c code. For win32 I
believe there's something out there called perl2exe, although I also
believe that that is _not_ a compiler.

See many other threads on this subject, check dejanews.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: 15 Oct 1998 02:04:27 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how to remove trailing spaces?
Message-Id: <703l7b$kec$2@client3.news.psi.net>

Antti-Jussi Korjonen (aajii@raaseri.ton.tut.fi) wrote on MDCCCLXX
September MCMXCIII in <URL:news:7039fu$pge$1@baker.cc.tut.fi>:
++ How do I remove trailing spaces?

FAQ.

++ $temp=~ tr/\s$//d; this doesn't work, what would?


What happened when you tried?



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: 15 Oct 1998 01:34:03 GMT
From: hjeeves@ppsclnt10.pok.ibm.com (Helena Jeeves)
Subject: Implementing 'union's in Perl to C extensions
Message-Id: <703jeb$cj8$1@poknews.pok.ibm.com>

I am working trying to create a Perl to C extension 
that involves a union.  The base Perl typemap doesn't
support this type!  I've been looking at Dean Roehrich's
'CookBooks', (very helpful!) but I'm stuck on this one.
Has anyone out there done this yet?

I have been able to model structures, but this union
is escaping me. Roughly, it is:

typedef union {
	int	value;
	char *	string;
	float	value2;
	double	value3;
} my_union;

thanks in advance

Helena Jeeves


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

Date: Thu, 15 Oct 1998 02:19:12 GMT
From: nolet@cam.org (Richard Nolet)
Subject: Re: NET::FTP problem
Message-Id: <703m3q$6sk@tandem.CAM.ORG>

All fixed as of build 503, etc...

You can download ActivePerl build 504 from the following location:

    http://www.ActiveState.com/ActivePerl/download/APi504e.exe

Yep, - no longer need to use passive mode to make NET::FTP work.
Check it out.



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

Date: Wed, 14 Oct 1998 21:43:59 -0400
From: Ted Kennedy <tedken@manning.com>
Subject: New book on Perl
Message-Id: <3625535F.411B2660@manning.com>



Manning Publications Co. is considering a proposal for a new book
entitled, "Object Oriented Perl" by Damian Conway and is looking for a
few people to evaluate a 3-4 page outline for  the book. If interested,
please send an email to <tedken@manning.com> and I will send you the
outline.









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

Date: Wed, 14 Oct 1998 21:32:05 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Perl FAQ - error found in "#How_do_I_get_a_file_s_timestamp_"
Message-Id: <36255EA5.D54CE867@us.ibm.com>

While answering someone else's FAQ by pointing them to the online HTML
FAQ, I noticed that there seems to be an error in the section
"#How_do_I_get_a_file_s_timestamp_".

The code reads:
    $write_secs = (stat($file))[9];
    print "file $file updated at ", scalar(localtime($file)), "\n";

The variable passed to localtime should be $write_secs and not $file.

Locally, I'm using version 5.004_02, and the error is in my copy of the
FAQ also.

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: 15 Oct 1998 02:04:25 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: splitting on meta chars
Message-Id: <slrn72am19.s3d.sholden@pgrad.cs.usyd.edu.au>

On Wed, 14 Oct 1998 12:37:19 -0700, valis@pacbell.net <valis@pacbell.net> wrote:
>I'm parsing a file that has a varying column delimiter.
>I have to split the records depending on the delimiter which could be any  meta char (\, $, |, etc)
>I have some code that uses eval but doesnt work
>Can someone help me write the code that takes care of all possiblilities?
>Help greatly appreciated.
>Kal.

<snip the aweful code>

You have something against reading the documentation???

'perldoc perlre' has the answer

In fact perlfaq6 has the answer too:
	'How can I quote a variable to use in a regexp?'



-- 
Sam

You are bordering on ridiculous if you think you need to support your
premises.  Such an argument is an infinite regression.
 	-- George Reese in <wv0O1.1521$Ge.4809664@ptah.visi.com>


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

Date: Wed, 14 Oct 1998 22:04:02 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: struggling with a regex... HEeeeelp!
Message-Id: <1dgwswx.hxq08s12xcqccN@bos-ip-2-161.ziplink.net>

[posted and mailed]

Dave Mee <davemee@tvlistings.co.uk> wrote:

>     $temp=~s/<\x23\\212>/\`/; # turn <\#212> into `
>     $temp=~s/<[\x23][\x5c]213>/[\x27]/g; # turn <\#213> into '
>     $temp=~s/<\x23\\209>/\-/; # turn <\#209> into -

Would it help if the characters in the search pattern were in the same
order as in the target string?

(You're searching for <#\212>, but your target string contains <\#212>.)

-- 
 _ / '  _      /         - 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: Thu, 15 Oct 1998 02:16:57 GMT
From: Francois Besnier <fbesnier@home.com>
Subject: Win32::OLE and Netscape
Message-Id: <36255ABC.C5955BA1@home.com>

Hi everybody,

I'd like to be able to use Netscape Communicator 4.05 with
ActiveState Perl (build 502) and Win32::OLE

Based on :
       
http://developer.netscape.com/docs/manuals/communicator/OLE/ole2net.htm

I wrote the following script:

        use Win32::OLE;

        $web = Win32::OLE->new("Netscape.Network.1")
        or die "Could not create a NEW Netscape Session: $! \n";

        $err = $web->Open( 'http://www.yahoo.com', 0, 0, 0, 0 )
        or die "Could not OPEN URL: $! \n";

	$contentlen = $web->GetContentLength();

	print "contentlen=$contentlen\n";

        $web->Read($content, $contentlen)
        or die "Could not READ URL: $! \n";

	print "content=$content\n";

	$web->Close();

This script returns:

contentlen=9120
Could not READ URL:

It seems that "$web->Read($content, $contentlen);" does not work.

Why did i get this error?

Regards,

- Francois

fbesnier@home.com


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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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