[9663] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3257 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 26 21:17:49 1998

Date: Sun, 26 Jul 98 09:06:51 -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           Sun, 26 Jul 1998     Volume: 8 Number: 3257

Today's topics:
    Re: ? about binmode() behavior <REPLY_TO_damonbrent@earthlink.net>
    Re: [Q] Multiplexing STDOUT to  already opened  Filehan (Mark-Jason Dominus)
    Re: A question about taint (Mark-Jason Dominus)
    Re: ARGV (Tad McClellan)
    Re: ARGV (Tad McClellan)
        Building and sorting a list of records <sto41@wanadoo.fr>
    Re: Code for deciding week number? <thomas@daimi.aau.dk>
    Re: File::Path::rmtree and Taint (Mark-Jason Dominus)
    Re: Help Reading a directory structure (M.J.T. Guy)
        nevermind I'm a dummy (no text) <REPLY_TO_damonbrent@earthlink.net>
    Re: newbie string questions. (Tad McClellan)
    Re: pattern matching snafus <jdf@pobox.com>
    Re: Perl Beautifier Page (Larry Rosler)
        Perl Module question <tdean@gte.net>
        Perl Y2K links here! (I R A Aggie)
    Re: problem undefining hash <jdf@pobox.com>
        program used to pass switches <dhartman@enter.net>
    Re: Question (Matthew Bafford)
    Re: Reacting to 1 of 10 or so possible values.... Need  (M.J.T. Guy)
    Re: Reacting to 1 of 10 or so possible values.... Need  <merlyn@stonehenge.com>
    Re: Reacting to 1 of 10 or so possible values.... Need  <minich@globalnet.co.uk>
    Re: Recent Secret Government Experiments Killing People <AVLEENSINGHVIG@nospammy.msn.com>
    Re: Recent Secret Government Experiments Killing People <wuns@sum.wer.co.uk>
    Re: Recent Secret Government Experiments Killing People <wuns@sum.wer.co.uk>
    Re: seek file <jdf@pobox.com>
    Re: Timeout, Socket, Windows (Andrew M. Langmead)
    Re: Using the hash (M.J.T. Guy)
    Re: Using the hash (Larry Rosler)
    Re: Win32 install prob--another idiot <tdean@gte.net>
        Win32 Perl and Perl doc <tdean@gte.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 26 Jul 1998 07:22:08 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: ? about binmode() behavior
Message-Id: <6pf8kv$aug$1@ash.prod.itd.earthlink.net>



>
>> or 'should' it also work using
>>
>>     read STDIN,$buffer,$length,$offset;
>>     print <SOMEFILE> "$buffer";
>
>If you check the return value from read, and if your variables are
>properly set, and if you fix the print statement to not use the line
>operator, binmode should work there. (And you could make me even happier
>by removing the superfluous quote marks from $buffer. :-)
>
>Hope this helps!

more and more pieces . . .

how do i fix the print statement not to use the line operator, i'm not sure
what you mean by that?

thanks,

brent




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

Date: 25 Jul 1998 22:09:25 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: [Q] Multiplexing STDOUT to  already opened  Filehandle(s)
Message-Id: <6pe34l$7am$1@monet.op.net>


In article <6p87ej$1ara@news.cnf.com>,
Mishra Aditya <mishra.aditya@emeryworld.com> wrote:
>I need to multiplex output from STDOUT to already opened file handles under
>SunOs 5.5.1

It's not clear to me what you want.
You say:
>I want to do the equivalent of freopen in perl.

That's easy; `freopen' what Perl's `open' command does:

	open STDOUT, "> /tmp/new-output"
	  or die ...;

But that doesn't sound like `multiplex'.  

If what you want is to have data that you print to STDOUT go to
several files, then `freopen' isn't what you want; it doesn't do that.
And there are two or three solutions I would recommend, but you say
none of the will work for you---I don't know why not, so perhaps it
would be more useful for you to say what is wrong with them, or what
you are really trying to accomplish.

>If this is not possible directly , 

What does `directly' mean?  You mentioned several ways to do it, but
unless you say why they are not `direct', we cannot suggest anything
else. 

>does anybody know the equivalent ioctl call I have to do to tie the
>stdout stream to other open streams.

If there is a low-level system facility for this, it would probably be
fcntl, not ioctl, and in any case it would be system-specific; you
have not said what system you are using, so there is no way to tell
whether your system supports such an fcntl.  Even so, I have never
heard of a system that supports this operation.

I am reluctant to make concrete suggestions without knowing more about
your problem; IO::Tee seems like the right answer to me, and you did
not say why it was unsuitable.  But three other possibile approaches are

1. Attach STDOUT to the `tee' program:

	open STDOUT, "| tee @files" or die ...;
	print "Snonk\n";		# Print to all files at once


2. Fork a child process to run your own private `tee' code:

	my $pid = open(STDOUT, "|-");
	if (!defined $pid) { die ... }
	if ($pid == 0) {  # Child process
	  tee();
	  exit 0;
	}

	print "Snonk\n";		# Print to all files at once

	sub tee {
	  open OUT1, ...;
	  open OUT2, ...;
	  open OUT3, ...;
	  while (<STDIN>) {
	    print OUT1;
	    print OUT2;
	    print OUT3;
	  }
	  exit 0;
	}

3. Use a tied filehandle.




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

Date: 25 Jul 1998 21:50:27 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: A question about taint
Message-Id: <6pe213$783$1@monet.op.net>


In article <6paedl$qfb$3@nz12.rz.uni-karlsruhe.de>,
Marc Haber <Marc.Haber-usenet@gmx.de> wrote:
>system("ls -al /some/dir") if $verbose&$some_mask
>fails if $verbose is tainted. Can anybody explain why?

Taintedness is computed per-statement.  At Perl has one variable,
`tainted', which determines taintedness, and `tainted' is set to 0 at
the beginning of every statement.  Accessing a tainted value sets
`tainted', and performing an unsafe operation like `system' checks the
value of `tainted'.  The result is that taintedness checking is
performed at the statement level, not the expression level.

In this case, `tainted' is set by your inspection of `$verbose', and
then `system' fails because the statement is now tainted.  To fix, use

	if ($verbose & $some_mask) {
	  system(...);
	}

Or untaint $verbose.

Statement-level tainting is for efficiency and for easy of
implementation, but it also makes possible the following trick:

	sub is_tainted {
	  ! eval { join('', @_) && kill 0 }
	}

If the arguments to this function are tainted, `kill' fails, even
though the argmuents cannot possibly affect the kill.  


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

Date: Sun, 26 Jul 1998 08:12:39 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ARGV
Message-Id: <70afp6.8o1.ln@localhost>

darrensw@pacbell.net wrote:

: Subject: ARGV

: I am using an argument vector to transfer info between subroutines ...
: pretty standard.


   _subroutines_ get their args in the @_ array, not the @ARGV array...



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 26 Jul 1998 08:10:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: ARGV
Message-Id: <qs9fp6.8o1.ln@localhost>

darrensw@pacbell.net wrote:
: On Sun, 26 Jul 1998 00:32:03 GMT, darrensw@pacbell.net wrote:

: I have been researching and think I have found the answer but don't
: fully understand how.

: Can anyone fully explain the next two lines to me please?:

: $ARGV[0] =~ s/\W//g;

   delete all non-word characters from the first argument.


: $ARGV[1] =~ s/\D//g;

   delete all non-digit characters from the second argument.




--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 26 Jul 1998 17:40:43 +0200
From: "Stephane Barizien" <sto41@wanadoo.fr>
Subject: Building and sorting a list of records
Message-Id: <6pfiq6$eeb$1@platane.wanadoo.fr>

I'm probably gonna be RTFMed on that one, but I couldn't find the answer.

I want to build a list of records in a loop, then sort that list according
to a given field.

I've tried:

{
 ...
push @lines, (field1 => $somevalue, field2 => $anothervalue);
 ...
}


@sortedlines = sort byfield2 @lines;

sub byfield2
{
$field2{$a} cmp $field2{$b};
}

but it doesn't work (of course! ;-)


Can anyone help?

TIA





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

Date: Sun, 26 Jul 1998 16:14:09 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Code for deciding week number?
Message-Id: <35BB39B1.EC0908F4@daimi.aau.dk>

Thomas Albech wrote:
> 
> Hi everyone,
> 
> How do you mathematically decide, which week number we are currently in?
> Is there any expression for it
> in combination with the Time module?
> 
> Thanks,
> Thomas

perldoc perlfaq4

Look for: 

How do I find the week-of-the-year/day-of-the-year?


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

Date: 25 Jul 1998 21:55:47 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: File::Path::rmtree and Taint
Message-Id: <6pe2b3$795$1@monet.op.net>


In article <6paedm$qfb$4@nz12.rz.uni-karlsruhe.de>,
Marc Haber <Marc.Haber-usenet@gmx.de> wrote:
>everything that is read from a directory is tainted.
>
>Is this a bug or a feature? 

It's a feature.  Anything under control of a (possibly hostile) user
is tainted.  The user could put files with bizarre names into a
directory, so filenames are tainted.

>How am I suppose to delete entire subtrees in a secure environment?

Untaint the filenames.  But what is the point of running such a
program in -T mode to begin with?


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

Date: 26 Jul 1998 12:09:19 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Help Reading a directory structure
Message-Id: <6pf69f$ab2$1@pegasus.csx.cam.ac.uk>

The Needham's <needcrew@tiac.net> wrote:
>HI,
>
>I am trying to pass a script the name of a directory and have the script
>read all the entries below that directory name.  If there are any sub
>directories then I want it to look in there to.  a sample directory
>structure is like this
>
>Images  - directory
>    image1.jpg - file
>    image2.jpg - file
>    Misc - subdirectory
>        Image 3.jpg -file
>    Other - subdirectory
>        image 4.jpg -file
>
>I have tried using
>
>opendir(DIR, $ARGV[0]) || die "Cannot open $ARGV[0]\n";
>@dirs = readdir(DIR);
>foreach $item (@dirs) {
> if (-d $item) {
>  push @newDirs, $item;
> }
>}
> to seperate the directories, but all I get is the "." and ".." directories.

You're testing the entry ./$item, rather than $ARGV[0]/$item.

But as the other respondents say, better to avoid all these little
bugs by using File::Find.


Mike Guy


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

Date: Sun, 26 Jul 1998 10:21:39 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: nevermind I'm a dummy (no text)
Message-Id: <6pfdu3$mvn$1@fir.prod.itd.earthlink.net>


i got it...hmm, maybe i understand why.  while(<STDIN>){read
STDIN,$buffer,$length} must be WRONG.
while( $how_much = read STDIN, $buffer, $length){#stuff} works soooo much
better. sorry if i wasted anyone's time.

brent




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

Date: Sun, 26 Jul 1998 08:16:39 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: newbie string questions.
Message-Id: <n7afp6.8o1.ln@localhost>

rainkid (rainkid@rainkid.com) wrote:
: Ok, i have  avariable, say $para, that contains a whole paragraph of text.
: what is the command that would cut $para so i stops when it sees a certain
: character?
: for example... let say i want &para to be the first sentence and not the
: whole paragraph so how would i set $para so i contains all the characters
: from the first to the first period?


   $para =~ s/^([^.]*\.).*/$1/s;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 26 Jul 1998 08:59:00 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: schnibitz@my-dejanews.com
Subject: Re: pattern matching snafus
Message-Id: <4sw4ogrf.fsf@mailhost.panix.com>

schnibitz@my-dejanews.com writes:

> @fields = split(/script.*script/,$line);

> The ".*" command will look for any non-newline character between and
> including "script" and "script" withing the text that the program read
> in.

To make the . metacharacter match a newline you need to use the /s
regex modifier, as documented in perlre.

> How do I modify this script so that it will read ahead to the next
> occurance of "script" regardless of whether there are newline
> characters?

Your expression will match not to the "next" occurrence of "script",
but rather the *last*, since * is greedy.  You should read about the
non-greedy modifier ? and also about zero-width negative lookahead
assertions.  It's all in the perlre document.

  $entire_file = do {local $/; scalar <FILE>};
  @scripts = $entire_file =~ /script(.*?)script/gs;

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Sun, 26 Jul 1998 07:47:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl Beautifier Page
Message-Id: <MPG.1024e17228665e61989795@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6pd6et$lnr$1@xmission.xmission.com> on 25 Jul 1998 11:59:57 -
0600, Snowhare <snowhare@xmission.xmission.com> says...
 ...
> As opposed to the 2038 bug, or the 2100 bug, or the 1900 bug? They are all
> _the same bug_: The failure to code for largest accomodatible time range
> rather than 'the next decade or so.' And while _YOU PERSONALLY_ may not
> have a need for dates before 1902 or after 2038, _a lot of other people
> have, do, or will need those dates_. Historians. Scientists. Researchers.
> Many others. Not everything people do _right now_ concerns events _right
> now_.

Then those people would be very ill-advised indeed to use the Unix epoch 
(which, as implemented universally at present, represents dates as 32-bit 
integral seconds based on the Unix Epoch, 1970 Jan 1 00:00:00 UTC).  

Representation, storage and manipulation tools should be chosen 
appropriate to the need.

 ...

> >One can build lots of enormous structures without accounting for the 
> >curvature of the Earth.  Or should you tell all the architects how 
> >*wrong* they are?

Representation, storage and manipulation tools should be chosen appropriate to the need.

> You mean like the people who built the Golden Gate Bridge? The tops of the
> supporting columns are _3 inches_ further apart than their bases. Not a
> significant error. Unless your cable is three inches too short.

Representation, storage and manipulation tools should be chosen 
appropriate to the need.

 ...
 
> >> Standards and simplicity are only useful to the degree that 
> >> they are _correct_. Placing hidden errors in standards where
> >> people can get bit by them without warning is simply _wrong_.
> >
> >Standards and simplicity are only useful to the degree that 
> >they are _useful_. Placing hidden costs in standards where
> >people can get bit by them without warning is simply _wrong_.
> 
> And, how exactly do people get 'bit' by a standard that _actually gives
> the right answer_ rather than one that _gives the wrong answer_? Hmmmm?? 
> You have a very odd definition of 'getting bit'.

You have a very odd definition of 'right' and 'wrong', at least in 
regard to date/time representation.  The Unix epoch is an 
approximation that defines a model of time in which every day is exactly 
86400 seconds long, and is measured from a particular well-defined 
reference date/time.  If this doesn't meet your needs, don't use it.

To give an analogy from physics, classical Newtonian mechanics is an 
approximation which is neither 'right' nor 'wrong'.  It can be used 
perfecty well to compute rocket trajectories, for example, even though 
quantum mechanics might be a more appropriate approximation in another 
problem domain.

Representation, storage and manipulation tools should be chosen 
appropriate to the need.

 ...

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 26 Jul 1998 10:34:03 -0400
From: "tdean" <tdean@gte.net>
Subject: Perl Module question
Message-Id: <6pferf$snh$1@news-2.news.gte.net>

I am looking for a perl module that will allow me to retrieve the IP address
assigned by an ISP when you use a dial-up connection. Any help or
information will be appreciated.TIA

--

replace at with @ and dot with .




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

Date: Sun, 26 Jul 1998 11:28:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Perl Y2K links here!
Message-Id: <fl_aggie-2607981128000001@aggie.coaps.fsu.edu>

<url:http://www.dejanews.com/dnquery.xp?QRY=*&ST=PS&DBS=1&defaultOp=AND&maxhits=25&format=terse&showsort=score&groups=comp.lang.perl.misc&authors=&subjects=Y2K&fromdate=&todate=>

Dejanews is your friend.

James


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

Date: 26 Jul 1998 09:11:57 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: sweth-usenet@astaroth.nit.gwu.edu (Sweth Chandramouli)
Subject: Re: problem undefining hash
Message-Id: <zpdwn1le.fsf@mailhost.panix.com>

sweth-usenet@astaroth.nit.gwu.edu (Sweth Chandramouli) writes:

>    undef %id_hash || die 'undef failed';

The value of the expression C<undef $foo> is C<undef>.  C<undef> is
false.

Furthermore, the technique you're trying to apply is really only
appropriate for system calls, like openinf and closing files, etc.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Sun, 26 Jul 1998 11:44:30 -0400
From: "Enter Net News" <dhartman@enter.net>
Subject: program used to pass switches
Message-Id: <35bb4e7f.0@news3.enter.net>

I saw this program in the Camel (2nd ed pg. 55) book and I am not quite sure
of one line.  the chunk of code looks like this:

while ($_ = $ARGV[0], /^-/) {
     shift;
     last if /^--$/;                                    # what does this
line do (why the $)
     if (/^-D(.*)/) {$debug = $1}
     if (/^-v/)       {$verbose++ }
 ...
}

Thanks for any help.

Dave
dhartman@enter.net








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

Date: Sun, 26 Jul 1998 13:35:59 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Question
Message-Id: <MPG.1024f38a8117701398968a@news.scescape.net>

In article <35bab22e.34451799@news.pacbell.net> on Sun, 26 Jul 
1998 04:37:23 GMT, darrensw@pacbell.net (a) felt the following 
information to be of use:
> I have a script which  generates lines of lets say products.
> 
> This list can get quite long.
> 
> Any ideas where i can find the code to have a max number of lines and
> then links to the next x number of items.
> 
> Thanks,
> 
> Darren
> 
If your looking for something similar to the way search engines 
display their data, take a look at this page by Randal Schwartz: 

http://w3.stonehenge.com/merlyn/WebTechniques/

You want co102.


Hope this helps!

--Matthew


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

Date: 26 Jul 1998 12:22:17 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Reacting to 1 of 10 or so possible values.... Need some streamlining help.
Message-Id: <6pf71p$ags$1@pegasus.csx.cam.ac.uk>

BullDog USMC <bulldog@usmc.net> wrote:
>I have a script that accepts <so far> about 10 different 'request
>types'.
>
>Right now, I am handling this by doing the clumsy:
>
>	if ($reqType eq "typeOne"){
>	   ...set up environment...
>	   ...execute routine(s)...
>	   exit;
>	}
>
>	if ($reqType eq "typeTwo"){
>	   ...set up environment...
>	   ...execute routine(s)...
>	   exit;
>	}
>
>Et cetera... 
>
>The problem is that each IF statement is getting more and more
>complex.
>
>Are there any suggestions on how to streamline this handling?

A Perlish way of doing this sort of thing is to use a hash as a dispatch
table:

my %actions = ( typeOne => \&process_type_one,
                typeTwo => \&process_type_two,
                     ...
              );

sub process_type_one { ... }

sub process_type_two { ... }

if (exists $actions{$reqType}) {
    $actions{$reqType}->();
} else {
    die "Unknown request type `$reqType'\n";
}



Mike Guy


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

Date: Sun, 26 Jul 1998 14:56:53 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Reacting to 1 of 10 or so possible values.... Need some streamlining help.
Message-Id: <8cu344k6du.fsf@gadget.cscaper.com>

>>>>> "Martin" == Martin  <minich@globalnet.co.uk> writes:

Martin> You could do:
Martin>  if ($reqType eq "typeOne"){
Martin>     ...set up environment...

Martin>     ...execute routine(s)...

Martin>  }
Martin>  elseif ($reqType eq "typeTwo"){
[snip]

Not in Perl you can't.

No such keyword as "elseif".  In fact, I have to work extra hard
to type it that way.

I'm sure you meant "elsif" instead. <grin>

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sun, 26 Jul 1998 15:59:42 +0100
From: "Martin" <minich@globalnet.co.uk>
Subject: Re: Reacting to 1 of 10 or so possible values.... Need some streamlining help.
Message-Id: <6pfg9q$c8v$1@heliodor.xara.net>

>Not in Perl you can't.
>
>No such keyword as "elseif".


Oops, I'm always doing that! Sorry, I did mean elsif!

Martin




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

Date: Sun, 26 Jul 1998 13:51:52 +0100
From: "The Lion King" <AVLEENSINGHVIG@nospammy.msn.com>
Subject: Re: Recent Secret Government Experiments Killing People!!!
Message-Id: <eUGpgQJu9GA.318@upnetnews05>

Oooooooooooooooooooo... ta very much!!

:))




Firestarter wrote in message <6pf05o$uu014@scotty.tinet.ie>...
>ahh thank god for offline NG reading
>found it!!!
>http://www.bigscience.com/setiathome.html
>their is contact details their
>i think you have to subscribe although it is more than likely free (worth a
>look anyway) in order to get the screen saver,which probably works online
>only and i doubt much people would let their puter be on its screen saver
>while being online for long
>
>also if you are very interested in this get in touch with progect Argus,the
>backyard SETI project
>you can find out more about this at
>http://www.setileague.org/general/whargus.htm
>
>
>
>ICQ UIN: 6036731
>phie site: http://dac.org/users/phie/right.html
>phie zine: http://phiezine.zeris.net/
>IRC: #hackers_ireland,#hackerzlair,#2600-uk.
>
>The Lion King wrote in message <#XjHR49t9GA.308@upnetnews03>...
>>
>>Firestarter wrote in message <6pc7q0$ivd9@scotty.tinet.ie>...
>>>they are still trying though and are making most of their money through
>the
>>>internet from people interested,you can get a screen saver that lets you
>>see
>>>frequencies on your screen.
>>
>>
>>OK, i looked everywhere i could think of. Any URLs for this screensaver?
>>
>>
>
>
>
>




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

Date: Sun, 26 Jul 1998 16:44:28 +0100
From: "Wum Sun" <wuns@sum.wer.co.uk>
Subject: Re: Recent Secret Government Experiments Killing People!!!
Message-Id: <901465756.27526.0.nnrp-01.c1ed4c0a@news.demon.co.uk>

Could someone explain the hacking/phreaking connection here please or is
this thread in the wrong newsgroup ?





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

Date: Sun, 26 Jul 1998 17:11:40 +0100
From: "Wum Sun" <wuns@sum.wer.co.uk>
Subject: Re: Recent Secret Government Experiments Killing People!!!
Message-Id: <901465804.27563.0.nnrp-01.c1ed4c0a@news.demon.co.uk>

Could someone explain the hacking/phreaking connection here please or is
it that this thread is in the wrong newsgroup ?







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

Date: 26 Jul 1998 08:43:21 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "gpsingh@mailcity.com" <gpsingh@mailcity.com>
Subject: Re: seek file
Message-Id: <7m10ohhi.fsf@mailhost.panix.com>

"gpsingh@mailcity.com" <gpsingh@mailcity.com> writes:

> I want to open a file , reach the file at a particular pattern and then
> do manipulation on the file from there on.

Perhaps this is the kind of thing you're looking for

  while (<>) {
     next if 1 .. /$today/;
     #do stuff
  }

That's the scalar range operator, as documented in perlop.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Sun, 26 Jul 1998 14:33:25 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Timeout, Socket, Windows
Message-Id: <EwpHrp.4CH@world.std.com>

d@d.cmm (-) writes:

>I have written a variaty of small servers and clients to do many things, but I 
>can't controll the timeouts on read() and write(). I would gladly use a fork() 
>and an alarm, but Windoz doesn't support the fork(), surprise.

>I understand that the socket has this option available, and that many folks 
>have handled this succefully with things like vec(), but I can't seem to find 
>clear documentation on what vec() does or how to actually set or get socket 
>options. ie; getsockopt() or setsockopt().

What I think you are looking for is the four argument version of
select(). The way the function is designed, you need to use vec() and
fileno() to set up the bitmap of sockets ready to read or write, but
it isn't vec() that is really handling the timeouts.

You can also use the IO::Select module, which puts I fairly nice
interface over select()
-- 
Andrew Langmead


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

Date: 26 Jul 1998 12:25:51 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Using the hash
Message-Id: <6pf78f$ai1$1@pegasus.csx.cam.ac.uk>

lloyd <lloyd007@best.com> wrote:
>
>"qw" may clash with future reserved word at password.cgi line 3syntax
>error in file password.cgi at line 3, next 2 tokens "qw("
>password.cgi had compilation errors.

I smell a dead camel!    What is the output from  "perl -v"?


Mike Guy


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

Date: Sun, 26 Jul 1998 07:26:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Using the hash
Message-Id: <MPG.1024dc8a977091d0989794@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35BA7AE2.6D05F2F3@sofnet.com> on 26 Jul 1998 00:39:12 -0500, 
Ben <ben@sofnet.com> says...
> Llyod,
> 
> Might want to do something about that strange little " after tom" in your hash.
> It could be the culprit.
> 
> Ben

It *might* be the culprit, Ben, but it isn't.  Did you try it at all 
before posting?  (Some people seem to have a disjunction between their 
Perl installations and their newsreaders.)

What is shown is patently correct Perl 5.

 ...
> > %words = qw(
> >    lloyd    lloyd
> >    leanne   loon
> >    tom"     kennedy
> > );
 ...
> > When I remove the qw I still get an error message even after I restore the
> > quote marks around the items in table? Can anyone help?

It would help to know the error message then.  I doubt that it still 
mentions "qw".

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 26 Jul 1998 10:30:24 -0400
From: "tdean" <tdean@gte.net>
Subject: Re: Win32 install prob--another idiot
Message-Id: <6pfekk$qsc$1@news-2.news.gte.net>

Neal:
see microsoft kb article Q150629
this may be obtained by sending an email to mshelp@microsoft.com and placing
the Q number in the Subject field

--
ICQ 7305805
replace at with @ and dot with .
Neal Miyake wrote in message <01bdb20c$ed402e80$4e0918cf@default>...
>Help!
>
>I'm trying to install Perl for Win32 (from Activeware, version 5.003) onto
>my NT Server running IIS3.  It loads fine, and seems to work.  I can do the
>"helloworld.pl" from the command line no prob (there is a path set to the
>perl.exe file)
>
>However, when I try and run a script through my browser (IE4), I get big
>time problems.  If I put a perl script in the c:\inetpub\perl\bin directory
>and try and run it, I get an 403.2 error (Forbidden read access).  If I put
>it somewhere under c:\inetpub\wwwroot tree, the script is displayed on the
>browser.
>
>I thought, when I installed it, it set any .pl file to run perl.exe.  What
>gives?
>
>Also, do I have to choose a particular "bin" directory exclusively to put
>my scripts in?  How do I set up the directory permissions or settings in
>NT?
>
>Please help me!  I am stressing under an extreme deadline.  Please copy to
>sponge@iav.com also.  Thanks, in advance.
>
>Neal Miyake




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

Date: Sun, 26 Jul 1998 10:32:33 -0400
From: "tdean" <tdean@gte.net>
Subject: Win32 Perl and Perl doc
Message-Id: <6pfeol$osk$1@news-2.news.gte.net>

does perl doc work on the activestate version of Perl? If not is there an
equivalent that will work?

--
ICQ 7305805
replace at with @ and dot with .




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

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

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