[11993] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5593 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 7 12:07:36 1999

Date: Fri, 7 May 99 09:00:31 -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           Fri, 7 May 1999     Volume: 8 Number: 5593

Today's topics:
    Re: "Safe" recursive delete? (M.J.T. Guy)
        ==> runnig perl programs without perl environment <== <Andreas.Fischer@germany.Sun.COM>
    Re: About perlre... (Tad McClellan)
        Auto web-form posting mglover@my-dejanews.com
    Re: Can't load IO.so error when trying to install CPAN  <tom.gebhardt@hboc.com>
    Re: Debug <gellyfish@gellyfish.com>
    Re: Declaration Help Please!! <morti_cne@my-dejanews.com>
        EXE file from a PERL blazek@sisblansko.cz
    Re: Exec error-Modification of a read-only.... <ebohlman@netcom.com>
    Re: Expect.pm problems (Brian Lane)
    Re: Extracting Emails from TXT (Tad McClellan)
        Find all files regardless of extension <clas.karrlund@nospamemw.ericsson.se>
    Re: Find all files regardless of extension <gellyfish@gellyfish.com>
    Re: Frequent Posters: new group for WWW applications of (I R A Aggie)
    Re: Generate matching strings from regex ? <uri@sysarch.com>
    Re: having problems getting this script to work... <uri@sysarch.com>
        help <ygongya@garnet.acns.fsu.edu>
    Re: How process a file? <gellyfish@gellyfish.com>
    Re: How process a file? (Tad McClellan)
    Re: how to grep -v ?? (Brian Peisley)
    Re: how to grep -v ?? (I R A Aggie)
    Re: how to round off numbers? <hunt@queen.es.hac.com>
    Re: Is evaluation of printf operands left-to-right? (M.J.T. Guy)
    Re: Making executables from .pl files? (Tramm Hudson)
    Re: Man Pages in Windows NT <tavi367@ibm.net>
        ODBC and Access memo fields <michaelw@palawnet.com>
    Re: OReilly bullshit.... Camel logo trademark bivey@my-dejanews.com
    Re: Perl script as "cat" - but slower (Matthew Bafford)
    Re: PERLFUNC: binmode - prepare binary files on old sys (I R A Aggie)
    Re: PERLFUNC: binmode - prepare binary files on old sys (Bart Lateur)
    Re: problems with SunOS 5.5 (I R A Aggie)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 7 May 1999 15:56:05 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: "Safe" recursive delete?
Message-Id: <7gv2el$135$1@pegasus.csx.cam.ac.uk>

Scratchie  <upsetter@ziplink.net> wrote:
>
>Perl won't let me do a 
>	system("rm -r $mydir")
>even if I've untainted $mydir first. 

Why not?    It works for me.

Aaaaaaaaaaaaargh!    I've just deleted my whole filesystem.   :-)


>I tried using "File::Find" but got basically the same result (this is of
>course adapted from the Perl Cookbook):
>
>sub zap {
>	# removes a given file or directory
>	
>	my $name;
>	if ( $File::Find::name =~ /^([\w\.\/\\-]+)$/ ) {
>		$name = $1;
>	} else {
>		die "Strange file name: $File::Find::name";
>	}
>	
>	if (!-l and -d _) {
>		rmdir ($name) or die "Could not remove $name: $!";
>	} else {
>		unlink ($name) or die "Could not unlink $name: $!";
>	}	
>}

That will fail if the filename is a relative one, since the current
directory has been set to $File::Find::dir.    Use $_ instead of
$File::Find::name.


Mike Guy


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

Date: Fri, 07 May 1999 16:58:27 +0200
From: Andreas Fischer <Andreas.Fischer@germany.Sun.COM>
Subject: ==> runnig perl programs without perl environment <==
Message-Id: <3732FF93.3DB0B43F@germany.Sun.COM>

Hi,
is there a posibility to run perl programs without a perl distribution,
maybe a kind of 
runtime libary?

Thanks in advance

Andi Fischer
-- 
***************************************************************

Andreas Fischer
Technical Account Manager (Finance Team)

SUN Microsystems GmbH		Tel: (++49) 6103 752 196
Amperestr. 6			Fax: (++49) 6103 752 161
D-63225 Langen			Andreas.Fischer@germany.sun.com

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


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

Date: Fri, 7 May 1999 06:32:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: About perlre...
Message-Id: <kffug7.ld8.ln@magna.metronet.com>

Federico Abascal (fabascal@gredos.cnb.uam.es) wrote:

: Do you know how
: to break a string into tokens of letters and numbers.
: For example:
: "hello34 5hola 222 que tal3 ar22e you"
: in hello 34 5 hola 222 que tal 3 ar 22 e you

: If it starts with numbers,  /(\d+)(\D+)/g works ok. But if sometimes
: starts with letters, how to do?


------------------
#!/usr/bin/perl -w
use strict;

$_ = 'hello34 5hola 222 que tal3 ar22e you';

while ( /([a-zA-Z]+|\d+)/g ) {
   print "token: '$1'\n";
}
------------------


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


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

Date: Fri, 07 May 1999 14:40:03 GMT
From: mglover@my-dejanews.com
Subject: Auto web-form posting
Message-Id: <7guu02$9n0$1@nnrp1.deja.com>

Greetings, all.

I have searched all the archives for an answer to this; I am trying to post
to a form on a website automatically using a Perl script.  Before everyone
starts harping about using the example in the Perl Cookbook, I can tell you
now that it DOES NOT WORK.  It DOES work for SOME sites, but for this one in
particular (and a few others I've found), it doesn't.  Here, the method used
is GET, but I get the same results for sites that use the POST method. 
Basically, the result returned here is just the form page itself, i.e., it
isn't the "query result" page.	For some reason, the CGI script at the other
end doesn't think that the "submit" button has been pressed...

At first, I suspected that there were hidden values being passed (and there
were) but adding these didn't help.

If anyone can get this code to work (or any similar code using the same URL)
please let me know.... please send me email, even if you also post to the
newsgroup....

The code follows:

#!/usr/bin/perl

use HTTP::Request::Common qw(GET);
use LWP::UserAgent;

$ua = new LWP::UserAgent;

my $req = GET 'http://wwwapps.ups.com/etracking/tracking.cgi',
        [       submit  => "Track",
                InquiryNumber1  => "XXXXXXXXXXXXXXXXXX",
                InquiryNumber2  =>      "",
                InquiryNumber3  =>      "",
                InquiryNumber4  =>      "",
                InquiryNumber5  =>      "",
                TypeOfInquiryNumber => "T"
        ];

my $res = $ua->request($req);

if ($res->is_success) {
        print $res->content;
} else {
        print "Bummer!\n";
}


Thanks,
Mike

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


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

Date: Fri, 07 May 1999 10:16:41 -0400
From: Tom Gebhardt <tom.gebhardt@hboc.com>
Subject: Re: Can't load IO.so error when trying to install CPAN modules
Message-Id: <3732F5C8.654169A1@hboc.com>

Problem seems to be resolved in 5.5.3.

Tom Gebhardt wrote:

> After regenerating perl5.5 patch 2 on a bsdi 4.0 system, I am no longer able
> to install any CPAN modules...  Full error message received is:
>
> Can't load '/usr/lib/perl5/5.00502/i386-bsdos/auto/IO/IO.so' for module IO:
> File not found at /usr/lib/perl5/5.00502/i386-bsdos/Dyna
> Loader.pm line 168.
>
> Can anyone help me out with this?



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

Date: 7 May 1999 15:42:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Debug
Message-Id: <3732fbd5@newsread3.dircon.co.uk>

Phillip Grobler <info@grobler.co.za> wrote:
> How do i Single step through a program on Win NT
> 

The perl debugger allows you to single step:

   perldoc perldebug

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Fri, 07 May 1999 15:17:49 GMT
From: CNE_Morti <morti_cne@my-dejanews.com>
Subject: Re: Declaration Help Please!!
Message-Id: <7gv06n$buc$1@nnrp1.deja.com>

Thanks to everyone who replied to my cry for help.  I appreciate your time and
efforts to help.

In article <7gm4o2$hfj$1@nnrp1.dejanews.com>,
  CNE_Morti <morti_cne@my-dejanews.com> wrote:
> Could someone point me in the right direction please.  I've read the docs and
> I just can't see the trees for the forest, so please don't flame too badly..
> I do appreciate your assistance.  I'm trying to declare department as the
> contents of a form field named dept.  If the contents of the $FORM dept
> matches 'Information' it sends to a specific E-Mail Address.  If the contents
> of the $FORM dept matches 'Technical Support' it sends to a different E-Mail
> Address.  The form contains a drop-down box for the customer to select.
>
> $department = "$FORM{'dept')";
> if ( $department eq 'Information' ) {
>    $recipient = 'someone@host.com';
> }
> elsif ( $department eq 'Technical Support' ) {
>    $recipient = 'another@host.com';
> }
>
> I know this is simple, but it's late and my brain isn't working.. keep banging
> my head against the wall..
>
> Thank You
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

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


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

Date: Fri, 07 May 1999 15:05:21 GMT
From: blazek@sisblansko.cz
Subject: EXE file from a PERL
Message-Id: <7guvfd$b9p$1@nnrp1.deja.com>

Recently I sent a question about making exe file from  Perl. Some of you
helped me and I would like to thank you all. But I would also like to thank
Indy Singh from http://www.perl2exe.com who have helped me a lot. They make a
great product perl2exe for converting Perl scripts to exe files At present I
am testing it and it seems to be very good.

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


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

Date: Fri, 7 May 1999 13:55:49 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Exec error-Modification of a read-only....
Message-Id: <ebohlmanFBD811.E7v@netcom.com>

Tom Bebee <bebeet@mail.welchallyn.com> wrote:
: The next record meets the "IMPORT" string search criteria and calls the
: Process_Import_Info routine, where the split function is failing with the
: error

: "Modification of a read-only value attempted at ./syslog_ftp.pl line 72
: <STDIN> chunk 3.

: sub Process_Import_Info {

: ($1, $2, $3, $4, $5, $6, $rectype, $8, $9, $fname, $11) =
:   split (/\s+/, $logrec);

Variables whose names consist of '$' followed by digits are special.  
They're set as a result of regex matches, and *cannot* be set by 
assignments.  perldoc perlvar will tell you more about Perl's special 
variables.

What's really going on here is that you want to use some, but not all, of 
the results of your split().  There are two ways to do this:

1) Replace all your "don't care" variables with 'undef' (without the 
quotes).  Assigning something to undef simply discards the result.

2) Use a list slice:

($rectype, $fname) = (split (/\s+/, $logrec))[6,9];



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

Date: 7 May 1999 14:42:15 GMT
From: brian@tatoosh.com (Brian Lane)
Subject: Re: Expect.pm problems
Message-Id: <slrn7j5urt.5nk.brian@gromit.tatoosh.com>

On Fri, 7 May 1999 02:47:36 GMT, Charles DeRykus <ced@bcstec.ca.boeing.com>
>wrote: In article <slrn7j2f7i.2t0.brian@gromit.tatoosh.com>, Brian Lane
><brian@tatoosh.com> wrote:
>>  Hello,
>>
>>  I'm having a hell of a time getting a simple Expect.pm script to work. I
>>ant to be able to use telnet via expect to do some things on my local
>>machine. But it keeps hanging after I send the username in response to the
>>login: prompt. It acts as if it isn't getting the CR (or CR/LF). I'm running
>>on a RedHat 5.1 Linux machine , kernel 2.0.36, perl version 5.004_04 built
>>for i386-linux. If I dump it into interact, then I can login normally.
>>.....
>>print $telnet "user\r";
> 
>Did you try just:    
>
>   print $telnet "user\n";
>
>Can you glean anything from: 
>
>   $Expect::Debug = 3; 

  Yes, I tries \n as well as \r\n, it appears to be some sort of enviornment
problem on that machine. I tried it on two of my other linux boxes and it
worked fine on both of them (they could even telnet into the box that the
script wouldn't run on).

  Thanks,

  Brian

-- 
--------[Inside  67.67]-------[Outside 31.55F]-------[Drink 64.37F]---------
Brian Lane/KC7TYU                             http://www.tatoosh.com/~brian
Nexus Computing                               http://www.nexuscomputing.com
Linux Consulting & Web Hosting                     brian@nexuscomputing.com


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

Date: Fri, 7 May 1999 03:41:01 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Extracting Emails from TXT
Message-Id: <de5ug7.eq7.ln@magna.metronet.com>

Matthew Bafford (dragons@dragons.duesouth.net) wrote:
: On Fri, 7 May 1999 02:02:31 GMT, Miles R. Fidelman <fidelman@world.std.com>
: lucked upon a computer, and thus typed in the following:
: : Tad McClellan (tadmc@metronet.com) wrote:
: : : joeyandsherry@mindspring.com wrote:
: : :    There have been no breakthroughs in the last several minutes.
: : :    This still cannot be done.
: : 
: : what's the big deal - you can do this with one line of grep and awk
: : commands, probably with sed too - it would take me a little longer in perl
: : 
: : but.. whether it's a GOOD thing to do is another question

: Of course, the original author's request (find every @ sign in a file and
: read all of the nonspaces before and after it) is quite possible.

: I'm sure Tad is talking about extracting email addresses from a message,
: which is not (quickly) possible.


   No, actually I was lying to the spammer.

   (of course, he/she/they might not be spammers, but I doubt it,
    given the .sig (and the posting 3 times of the same question)
   )


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


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

Date: Fri, 07 May 1999 14:52:58 +0200
From: Clas <clas.karrlund@nospamemw.ericsson.se>
Subject: Find all files regardless of extension
Message-Id: <3732E22A.133B6117@nospamemw.ericsson.se>

Hi 

I want to know if a file called  "filename.*", e.g "filename.txt" or
"filename.exe", exists in a directory .

I tried to serch for "filename.*" in the directory, but it din4t seem to
work.

Do you have any solution to this problem. Please let me know!

Thanks

//Clas
(remove nospam to mail)


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

Date: 7 May 1999 15:41:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Find all files regardless of extension
Message-Id: <3732fb9e@newsread3.dircon.co.uk>

Clas <clas.karrlund@nospamemw.ericsson.se> wrote:
> Hi 
> 
> I want to know if a file called  "filename.*", e.g "filename.txt" or
> "filename.exe", exists in a directory .
> 
> I tried to serch for "filename.*" in the directory, but it din4t seem to
> work.
> 

By your reference to a .exe file I presime you are on Windows
check this out:

C:\WINDOWS\Desktop>perl -e "print join qq&\n&,<*.html>"
index.html
men.html
New Microsoft HTML Document 4.0.html
radiustemp.html
x.html

I have heard some people saying that glob() doesnt work properly on NT
if that is the case you might need to examine the functions:

  opendir()
  readdir()
  closedir()


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: 7 May 1999 13:38:15 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Frequent Posters: new group for WWW applications of Perl?
Message-Id: <slrn7j5rb4.om7.fl_aggie@stat.fsu.edu>

On Fri, 07 May 1999 11:25:38 GMT, Bart Lateur <bart.lateur@skynet.be>, in
<3734c995.15595349@news.skynet.be> wrote:

+ A] "comp.infosystems.www.authoring.cgi" is a contradiction in terms.
+ "CGI" is not authored. Authoring is dabbling in something like
+ Powerpoint or Macromedia Director. CGI is programmed.

Can you truely say that perl is programmed and not authored?

>From <url:http://www.news.com/News/Item/0,4,0-36217,00.html?st.ne.lh..ni>

	Bernstein's attorneys argued that source code was a form of
	speech for programmers, and that he should not be subject to
	prior review by the government before publishing his
	ideas. The government countered that source code doesn't
	express ideas and is simply used to control the operation of a
	computer.

	The Appeals Court today agreed with Bernstein.

James


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

Date: 07 May 1999 09:53:38 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Generate matching strings from regex ?
Message-Id: <x76765ugt9.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> vepxistqaosani wrote:
  >> As a new user, I find that regexen are occasionally (well, always)
  >> difficult to read. It would be helpful to have a script that could take
  >> a regex as input and produce a matching string.
  >> 
  >> So, if the input is
  >> /(.*)\d\s\w(.*)/
  >> some possible outputs are
  >> "any0 Xany"
  >> "any7\tbany"
  >> etc.

  BL> Interesting. I might take that up one day. :-)

did you see ronald's post of his working example of that?

work on improving it rather than starting from scratch.

  BL> As a first side remark: you cannot do everything using regexes alone.
  BL> Nested submatches don't translate into regexes. You probably would need
  BL> a parser for that. Example of nested submatches:

  BL> 	/(a(b*)c)/

don't let ilya see that message or you will get it! :-)

the bleeding edge 5.005_xx versions has support for nested
submatches. don't ask me to quote an example since i feel only ilya know
how to use it!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 07 May 1999 10:05:28 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: having problems getting this script to work...
Message-Id: <x73e19ug9j.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> I don't set $, all the time. Often I set it once, at the top of the
  BL> script, so it's OBVIOUSLY valid for the whole script. So this is my
  BL> version:

  BL> 	print @array;

  BL> Now which is clearer? :-)

as you posted elsewhere, you need to localize $, and $\ when you want to
do something different. i prefer to leave them alone by default and use
join to print when i need tab separated fields.

it depends on how you view priorities of controlling output. i debug a
lot with print statements so having a different default for $, would
mess me up. as i print to the tab file in usually only 1 place, it is
easier to to the join stuff for me there. 

TIMTOWTDI.

  BL> p.s. I'm getting bored of this...

same here. 

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Fri, 07 May 1999 08:27:45 -0700
From: Gongya Yu <ygongya@garnet.acns.fsu.edu>
Subject: help
Message-Id: <37330670.F75A3001@garnet.acns.fsu.edu>

Anyone can tell me what is the problem when I run the following code in
the cron job

open(RATEUP,"-|") || exec @exec;

This works fine from the command line, but not from the cron job.

thanks !!!

Gongya Yu



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

Date: 7 May 1999 12:51:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How process a file?
Message-Id: <3732d3db@newsread3.dircon.co.uk>

dtillaud@hotmail.com wrote:
> 
> I'd like to open a file and to check if a string is into this file.
> I do as bellow :
> 

Lets see ...

>    $EverPlay=0;

Unless you have already used a variable it will spring into life the
first time it is used in a numeric fashion with a value of zero.

#>    $Buffer=$NameP;
#>    $Buffer.=' ';
#>    $Buffer.=$SurnameP;

You could just as easily have done:

      $Buffer = "$NameP $SurnameP";

Or Alternatively:

      $Buffer = join ' ',$NameP,$SurnameP;

#>    open(FILE,"<file.txt");

Always, always, always check whether your open worked:

     open(FILE,'file.txt') || die "Cannot open file.txt = $!\n";

>    while(<FILE>)
>    {
#>       $Line = <FILE>;

That is redundant as you already have a line in $_ you are effectively
ignoring half the lines in your file.

#>       if($Line =~ /$Buffer/)
#>       {
#>          $EverPlay=1;
#>       }

And having the line in $_ you can use it as the default operand of a match
and you can use a shortcut operator in order to reduce those four lines
to one:

         $EverPlay = 1 if /$Buffer/;

I have assumed there that you are actually testing for the equality
of $EverPlay to 1 - however a widely used idion would be:

         $EverPlay++ if /$Buffer/;

Which you could later test like:

        if($EverPlay)
         {

           # Do something

         }


>    }
>    close (FILE);
> 


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Fri, 7 May 1999 06:29:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How process a file?
Message-Id: <hafug7.ld8.ln@magna.metronet.com>

dtillaud@hotmail.com wrote:

: I'd like to open a file and to check if a string is into this file.


:    while(<FILE>)
           ^^^^^^       read a line
:    {
:       $Line = <FILE>;
                ^^^^^^       read a line

:       if($Line =~ /$Buffer/)
:       {
:          $EverPlay=1;
:       }
:    }
:    close (FILE);

: The problem is that Everplay becomes true only if the string is twice inside.
: Please help!!


    Because you are reading lines in two places but only attempting
    the pattern match in one of the places.

       while($Line = <FILE>)


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


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

Date: Fri, 07 May 1999 13:26:19 GMT
From: brian@helka.mutagenic.org (Brian Peisley)
Subject: Re: how to grep -v ??
Message-Id: <slrn7j5qje.s3.brian@helka.mutagenic.org>

In pkey@sghms.ac.uk <pkey@sghms.ac.uk> writes:
>i want to grep an array and return lines that do not contain the
>pattern i.e. grep -v
>
>@ok = grep -v (/data/, @passwd_array);
>
>obviously the above line doesn't work - is there a way of doing this?

Being fairly new to Perl, I like trying to figure out things like this for
myself.  I typed in 'perldoc -f grep' to see if I could figure this one out.
Unfortunatly, right there in the documentation was exactly how to do it:

    @foo = grep(!/^#/, @bar);    # weed out comments

I'm sure you can imagine my frustration at finding documentation so good...

-- 
Brian Peisley
bdp@mutagenic.org


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

Date: 7 May 1999 13:40:46 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: how to grep -v ??
Message-Id: <slrn7j5rfr.om7.fl_aggie@stat.fsu.edu>

On Fri, 07 May 1999 12:08:47 GMT, pkey@sghms.ac.uk <pkey@sghms.ac.uk>, in
<3732d707.13609925@news.dl.ac.uk> wrote:
+ i want to grep an array and return lines that do not contain the
+ pattern i.e. grep -v
+ 
+ @ok = grep -v (/data/, @passwd_array);

@ok = grep (!/data/, @passwd_array);

James - ! is not


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

Date: Fri, 07 May 1999 07:07:51 -0700
From: KC <hunt@queen.es.hac.com>
Subject: Re: how to round off numbers?
Message-Id: <3732F3B7.A6AB0299@queen.es.hac.com>

Tad McClellan wrote:
> : Oh...you must be one of those all-knowing geniuses that only uses
> the ng
> : to post examples of their brilliance.
> 
>    Ouch!
> 
>    Making an ass of yourself in front of thousands of people
>    has gotta hurt.

"The trick, my friend, is not minding that it hurts..."

				-Lawrence of Arabia

"Stupid is as stupid does"
				-Forest Gump

I don't know which one applies here.
-- 
-----

KC


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

Date: 7 May 1999 15:46:06 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Is evaluation of printf operands left-to-right?
Message-Id: <7gv1ru$h6$1@pegasus.csx.cam.ac.uk>

William Blasius #42722  <Wm.Blasius@ks.sel.alcatel.de> wrote:
>Hello,
>
>I have discovered something strange, and I can't explain it so I hope
>someone can shed some insight into this. Consider:
>
>my @rray = ( 'one', 'two', 'three' );
>printf "stacksize %d, the first was: %s\n", $#rray, pop @rray;
>
>now consider the result:
>stacksize 1, the first was: three
>stacksize 0, the first was: two
>stacksize -1, the first was: one
>stacksize -1, the first was: 
>
>the scalar is apparently evaluated after the pop. Is this the
>expected behaviour? It certainly surprised me. The workaround 
>is obvious, but my curiosity is aroused.

In general, Perl doesn't define order of evaluation of expressions.
Future optimisations may change it.    So don't do that.

And as another example, compare and contrast:

        perl -wle 'print $a++, $a++, $a++'
        perl -wle 'print ++$a, ++$a, ++$a'


Mike Guy


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

Date: 7 May 1999 08:05:17 -0600
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: Making executables from .pl files?
Message-Id: <7gurut$ba5@llama.swcp.com>

[posted and cc'd to cited author.
 Followups to sci.crypt, where this is more germane but has FAQ status]

In article <7guaqj$pa8$1@nnrp1.deja.com>,  <ralawrence@my-dejanews.com> wrote:
[snip]
> ... If you wrote
> an inpressive encryption/decription system then you might not want to hand
> out the source code.
[snip]

Now that is perhaps the least appropriate example of a situation in
which it would be proper to hide source code.  If you write an
impressive crypto scheme you had better make the algorithm and the
code public for scrutiny and review.  Otherwise you're just selling
snake oil that is worthless for "serious" use.  Security via obscurity
is not security at all.

Look at Clipper (Slipjack) for a good gauge of the crypto community's
reaction to a "closed source and algorithm" cypher.  It was 
roundly criticized and rejected, both of the key escrow policy and
the lack of public review.  Just because the NSA says it is safe
is a good reason to distrust it...

I also have reservations about the current crop of closed RC(\d+) key
stream generators.  Just because they are produced by Rivest, et al
doesn't mean that they are safe.

Some resources on this particular topic :

	http://www.dejanews.com/[ST_rn=qs]/getdoc.xp?AN=288470518
	http://www.counterpane.com/pitfalls.html

Good luck hiding your source from determined (cr|h)ackers.
Tramm
-- 
  o   hudson@swcp.com                 tbhudso@cs.sandia.gov   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.266.59.96   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.284.24.32   \ \/\_\  
  0                                                            U \_  | 


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

Date: Fri, 7 May 1999 09:00:44 -0500
From: "tavi" <tavi367@ibm.net>
Subject: Re: Man Pages in Windows NT
Message-Id: <3732f1e4@news1.us.ibm.net>

Jonathan Stowe wrote in message <37319dc0@newsread3.dircon.co.uk>...
>Martijn van der Kooij <DeleteThisdev@stabiplan.nl> wrote:
>> Probably off topic, but i'm wondering how I can view man files in Windows
>> NT.
>>
>> Has someone the source of the man utility, or does someone know where to
>> start searching?


I have something that will convert MAN pages to HTML.

If interested, let me know.

Walter





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

Date: Fri, 07 May 1999 14:26:31 GMT
From: gregarine <michaelw@palawnet.com>
Subject: ODBC and Access memo fields
Message-Id: <7gut6h$90g$1@nnrp1.deja.com>

I am using Active Perl on NT using ODBC to access a memo field out of
Access97. The problem is that I am only getting part of the memo field loaded
into my perl variable.	Their is a long article in the memo field.  It seems
due to some sort of character limitation because when i cut stuff out of the
memo field I am able to load a bit more.  Thus I don't think it is due to
some sort of unrecognizable caharacter or an EOF.

Here is the code:

while ($db->FetchRow()){
	($body, $submitted, $yourtitle, $pub, $datesub, $datepub, $title,
$category) = $db->Data('Body', 'Submitted_By', 'Your_Title',
'Publication', 'Date_Submitted', 'Date_Published', 'Title',
'Category');
	print "<TR><TD>$title</TD></TR>";
	print "<TR><TD>$body</TD></TR>";
}

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


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

Date: Fri, 07 May 1999 14:56:04 GMT
From: bivey@my-dejanews.com
Subject: Re: OReilly bullshit.... Camel logo trademark
Message-Id: <7guuu0$aoq$1@nnrp1.deja.com>

In article <7gpvtq$jbs$1@ffx2nh3.news.uu.net>,
  <mkruse@netexpress.net> wrote:

> What O'Reilly should do is allow the camel to become a public symbol for
> Perl, but maintain the trademark for books about Perl. Seems logical to
> me.

Kinda hard to do and be sure you meet the requirements of defending
your trademark under U.S. law. This is why Coke sues people who insist
on selling you a Pepsi when you ask for a Coke. Why Xerox gets huffy
about people calling a photocopy a Xerox. Etc. Sometimes brand recognition
can go too far. (Aspirin and Heroin were both trademarks of Bayer Co.
once upon a time, look what happened there.) -Wm

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


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

Date: Fri, 07 May 1999 14:06:23 GMT
From: dragons@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Perl script as "cat" - but slower
Message-Id: <slrn7j5rbr.68q.dragons@dragons.duesouth.net>

On Fri, 07 May 1999 07:26:18 GMT, caf <caf0013@my-dejanews.com>
lucked upon a computer, and thus typed in the following:
: Is there are way to go through a configurable number of characters and then
: pause rather than be line based ?

PCB, 1.6:

#!/usr/bin/perl
# slowcat - emulate a  s l o w  line printer
# usage: slowcat [-DELAY] [files ...]
$DELAY = ($ARGV[0] =~ /^-([.\d]+)/) ? (shift, $1) : $1;
$| = 1;
while (<>) {
    for (split(//)) {
        print;
        select(undef,undef,undef, 0.005 * $DELAY);
    }
}
 
: thanks

HTH,

--Matthew


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

Date: 7 May 1999 13:48:35 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: PERLFUNC: binmode - prepare binary files on old systems
Message-Id: <slrn7j5rug.om7.fl_aggie@stat.fsu.edu>

On Thu, 6 May 1999 18:10:47 -0700, Larry Rosler <lr@hpl.hp.com>, in
<MPG.119bdd741d5065559899ea@nntp.hpl.hp.com> wrote:

+ God Forbid you should name them!  Is it possible that not evey user of 
+ Perl on such systems knows that MS-DOS lurks underneath, either in 
+ reality or in its legacy of file formats?

There are a number of people, upon being told that Win95/Win98 was merely
a graphical shell over MS-DOS, that gazed upon me as if I had just sprouted
a second head and was prophisizing the end of Redmond.

James

Windows 95: 32-bit extensions and a graphical shell for a 16-bit patch
to an 8-bit operating system originally coded for a 4-bit
microprocessor, written by a 2-bit company that can't stand one bit of
competition.


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

Date: Fri, 07 May 1999 15:43:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: PERLFUNC: binmode - prepare binary files on old systems
Message-Id: <37380949.1180777@news.skynet.be>

Larry Rosler wrote:

>> DESCRIPTION
>>     Arranges for FILEHANDLE to be read or written in "binary" mode on
>>     systems whose run-time libraries force the programmer to guess
>>     between binary and text files.
>
>It is hard to believe that a 'programmer' doesn't know!  A text file 
>consists of a sequence of characters organized into lines (i.e., with 
>chunks terminated by line endings, whatever they may be).  A binary file 
>is a sequence of characters without such an organization.  Sheesh!

Makes you wonder why Unix (and Perl) needs the -T and -B filetest
operators anyway...

                -T  File is a text file.
                -B  File is a binary file (opposite of -T).

	Bart.


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

Date: 7 May 1999 14:29:25 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: problems with SunOS 5.5
Message-Id: <slrn7j5ub0.om7.fl_aggie@stat.fsu.edu>

On Thu, 6 May 1999 22:32:22 -0400, Peace Computer Systems <peace@ovis.net>, in
<Pine.LNX.3.96.990506222107.8152A-100000@ns1.ovis.net> wrote:

+ even though i get "syntax OK" when i run perl -c filename.cgi, i still get
+ the big "SERVER ERROR blah blah blah" when i execute the script through a
+ browser.  however, the script runs without a hitch on a linux 5.0 box
+ (through a browser).  any suggestions? 

Yeah...they're not perl-related tho. What does your server's error log
show?

ObPerl: you may want to add this to your program:

use CGI::Carp qw(fatalsToBrowser);

I have a feeling you're running into permission problems, or 'file not
found' sorts of things.

+ ps - the code is about 500 lines, i didn't think it appropriate to post it
+ here.

Ummm...does this look like the CGI help desk??? ;)

James


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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