[6862] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 487 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 16 14:17:50 1997

Date: Fri, 16 May 97 11:00:32 -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, 16 May 1997     Volume: 8 Number: 487

Today's topics:
     (?:) vs. () (Justin C Lloyd)
     Re: Baffled (Tad McClellan)
     Re: Baffled (Tad McClellan)
     Couldn't reopen stderr ...? <libes@com.univ-mrs.fr>
     Re: gzip/zmore in perl? (Andrew M. Langmead)
     Hex/Base-n conversion aaronh@acm.org
     Re: How to stop FOMAT putting space between fields? (Mark Mills)
     Learn perl5 faster by using tcsh aaronh@acm.org
     Re: List of List Question I think (assigning LOTS of va (A. Deckers)
     Re: MacPerl & Applescript <neeri@iis.ee.ethz.ch>
     Re: MacPerl & Applescript (Chris Nandor)
     Q: Perl/Cgi under Windows NT <per.marstein@hda.hydro.com>
     Re: regrex question - really basic! (Tad McClellan)
     Re: regrex question - really basic! (David Alan Black)
     Re: search and replace (Mike Stok)
     Re: search perl doku (Mike Stok)
     Re: Second attempt at problem (getting dynamic librarie (David Alan Black)
     something like cflow? <schmeil@pixelpark.com>
     Spy people on the Net (Future-NET)
     Re: Undump Question... <sarah@ecl.wustl.edu>
     Re: What's the quickest way in perl to determine if a s (David Cross)
     Re: winnuke (Magnus Bodin)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 16 May 1997 10:44:56 GMT
From: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: (?:) vs. ()
Message-Id: <5lhdr8$8di$1@news.fsu.edu>

For some reason, in a regex I'm using, (?:) is actually *slower* than ().  I
can't figure out for the life of me why, because everything I've read states
that it should be faster.  Here is the code:

   my @matches;
   eval '@matches = grep {
      $_->[5] =~ /^$first/io
        &&
      $_->[5] =~ /^($first|$firstinit)?\s+($middle\s+)?$last$/io
   } @{$passwd{$last}};';

Any ideas?

JcL

-- 
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant                phone: 904/644-0559
Department of Computer Science             email: lloyd@cs.fsu.edu
Florida State University                   www:   http://www.cs.fsu.edu/~lloyd

                               P + L = :)


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

Date: Thu, 15 May 1997 23:48:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Baffled
Message-Id: <duogl5.1l2.ln@localhost>

I myself (tadmc@flash.net) wrote:
: RMO (isainfoserv@mindspring.com) wrote:
: : I'm stuck.  Below is the core of a script that accepts info ($keys)
: : typed into a html form. The below sub routine searches a quote, tab
: : delimted text database (pilotrmo.tab) for the persons/items in the
: : database that matches all items (items defined as separated by spaces)
: : in $keys.  I.E. I type 'John Doe' in my form and the script returns
: : all  listings that contain 'John' and 'Doe'.  My quandry is that if
: : you enter 'Doe John' (out of order as compared to the database), it
: : doesn't find the listing. What am I doing wrong?
:                             ^^^^^^^^^^^^^^^^^^^^^

: Short version: using m//gi when you want to be using m//g
                                                       ^^^^
                                                       ^^^^

Ack! Make that m//i ...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 16 May 1997 05:55:20 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Baffled
Message-Id: <oeehl5.8s3.ln@localhost>

Tad McClellan (tadmc@flash.net) wrote:
: RMO (isainfoserv@mindspring.com) wrote:
: : I'm stuck.  Below is the core of a script that accepts info ($keys)
: : typed into a html form. The below sub routine searches a quote, tab
: : delimted text database (pilotrmo.tab) for the persons/items in the
: : database that matches all items (items defined as separated by spaces)
: : in $keys.  I.E. I type 'John Doe' in my form and the script returns
: : all  listings that contain 'John' and 'Doe'.  My quandry is that if
: : you enter 'Doe John' (out of order as compared to the database), it
: : doesn't find the listing. What am I doing wrong?


: From the perlop man page:

: -------------------------------
: In a scalar context, C<m//g> iterates through the string, returning TRUE
: each time it matches, and FALSE when it eventually runs out of
: matches.  (In other words, it remembers where it left off last time and
:  ...
: -------------------------------

: So, it returns false when it gets to the end of the string...


Uh... That's not why.

It is because "it remembers where it left off".

So, when the DB has "John Doe other stuff" but you searched for "Doe" 
first, it starts trying to match *after* Doe when you get around to
searching for "John", but the John part is before the "Doe".



Sorry, I'll try to not read news after my bedtime anymore...   ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 16 May 1997 14:39:48 +0200
From: libes maurice <libes@com.univ-mrs.fr>
Subject: Couldn't reopen stderr ...?
Message-Id: <337C5594.341E@com.univ-mrs.fr>

hello to all
i have an error returned from a cgi perl script, that i can't explain...
who can help me?

This perl script is run as a cgi program... it has to launch a "ph"
program to access a ccso/ph/qi phone database...
(nb:the ph command runs succesfully under a unix shell)

the error returned by the cgi perl script is :
     "Couldn't reopen stderr"

i dont know what to do...

thanks for any help 

===============here below my summarised cgi perl script============
#!/PROGRAMMES/EXE_700/perl
print "Content-type: text/html\n\n";
 
# Print a title and initial heading
print "<Head><Title>Result</Title></Head>";
print "<Body bgcolor=\"#ffffff\">";
 
$resul  = `/PROGRAMMES/EXE_700/ph libes`;
foreach $l ($resul) {
 print "ligne $l <br> ";
}


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

Date: Fri, 16 May 1997 12:09:24 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: gzip/zmore in perl?
Message-Id: <EA9wFo.7v7@world.std.com>

GuideQueue Master <quemast@bvsd.k12.co.us> writes:

>	Is there any way to read and write to a gzip file in PERL w/o
>using an external command?  (I'd really hate to fork a shell for this, I
>just re-wrote my log manager in PERL to avoid the extra processes).

Every other week, an article is crossposted to news.answers,
comp.answers, and comp.lang.perl.modules with the title
"comp.lang.perl.modules The Perl 5 Module List (Reusable Software)".

It contains a list of freely available software modules for perl. Most
are available via the CPAN network of FTP
sites. <http://www.perl.com/CPAN/>.

In the module list, you will find this section:

>17) Archiving, Compression and Conversion
>
>Name           DSLI  Description                                  Info
>-----------    ----  -------------------------------------------- -----
>Compress::
>::Zlib         adcO  Interface to the Info-Zip zlib library       PMQS


On the other hand, I wouldn't worry too much about calling the gzip
program. On a modern unix system, process creation is fairly cheap,
but with the current state of compression theory, good compression and
and decompression are still fairly expensive.
-- 
Andrew Langmead


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

Date: Fri, 16 May 1997 07:21:39 -0600
From: aaronh@acm.org
Subject: Hex/Base-n conversion
Message-Id: <863784957.14428@dejanews.com>

Here's something I hope you find useful:

#!/usr/bin/perl

sub cmds {
  print <<'EOF';

Command   | Examples        | Description
==========+=================+=============================
 [number] | 0xff 0666 _1001 | convert number to other base
 <        | < 16            | default input base n (EG 16)
 +        | + 32            | add ouput for base n (EG 32)
 -        | - 32            | no output for base n (EG 16)
 q        |                 | quit (when < base 27 input)
 ctrl-c   |                 | quit
 h        |                 | help (when < base 18 input)
 ?        |                 | help

EOF
}

print <<'EOF' if( !@ARGV );

hx V0.99 by Aaron Hightower
email: aaronh@acm.org
http://members.tripod.com/~ah

EOF

@b = ();
$inmode  = 10;
$done    = 0;
%b = (
  "16", 1,
  "10", 1,
   "8", 1,
   "2", 1
);
while(1) {&go};

sub go {

  my( $cinmode ) = $inmode;

  # Get input from user and quit if requested
  print "Enter command (? or h for help)> ";
  $_ = scalar <STDIN>;
  if( !$_ ) { print "\n"; exit; }
  chop;
  next if( $_ eq "" );
  s/^\s+//g; # Remove leading  white space
  s/\s+$//g; # Remove trailing white space

  exit if( /^q/  && $cinmode < 27 );
  if( /^\?$/ || ( /^h/ && $cinmode < 18 ) ) {
    &cmds;
    return;
  }
  elsif( /^0x/  ) {$cinmode = 16; s/^0x//; }
  elsif( /^0/   ) {$cinmode =  8; s/^0+//g;}
  elsif( /^_/   ) {$cinmode =  2; s/^_+//g;}
  elsif( /^\<\s*(\d+)$/ ) {
    if( $1 > 36 ) {
      print "Max is 36 (0-z)";
      return;
    }
    $inmode=$1;
    print "Input is now base $1\n";
    return;
  }
  elsif( /^\+\s*(\d+)$/ ) {
    if( $1 > 36 ) {
      print "Max is 36 (0-z)";
      return;
    }
    $b{$1}=1;
    print "Add output for base $1\n";
    return;
  }
  elsif( /^\-\s*(\d+)$/ ) {
    undef( $b{$1} );
    print "Remove output for base $1\n";
    return;
  }

  my( $out   ) = 0;
  my( $value ) = 0;
  my( $bad   ) = 0;
  my( $mult  ) = 1;
  my( $input ) = $_;

  while( $input ) {

    my( $d );
    my( $o ) = ord( chop( $input ) );

       if( $o>=ord("0")&&$o<=ord("9") ) { $d=$o-ord("0");    }
    elsif( $o>=ord("a")&&$o<=ord("z") ) { $d=$o-ord("a")+10; }
    elsif( $o>=ord("A")&&$o<=ord("Z") ) { $d=$o-ord("A")+10; }
    else { $bad = 1; }

    $bad = 1 if( $d >= $cinmode );

    if( $bad ) {
      print <<EOF;
Illegal character in input for a base $cinmode number
Use prefix 0x for hex, 0 for octal, _ for binary
default is currently base $inmode
(you may change this with the < command)
EOF
      return;
    }

    $out = $out + $d * $mult;
    $mult = $mult * $cinmode;
  }

  $ascii = &cvt( 256, $out );

  printf("Dec:   $out\n")                  if( $b{10} );
  printf("Hex: 0x%s\n", &cvt( 16, $out ) ) if( $b{16} );
  printf("Oct:  0%s\n", &cvt( 8,  $out ) ) if( $b{8}  );
  printf("Bin:  _%s\n", &cvt( 2,  $out ) ) if( $b{2}  );
  printf("Asc:  \"%s\"\n", $ascii )
    if( $ascii =~ /^[\w\d\ ]+$/ );

  foreach ( keys %b ) {
    next if( $_ == 10 || $_ == 8 || $_ == 16 || $_ == 2 );
    printf( "Base %s: %s\n", $_, cvt( $_, $out ) );
  }
}

sub cvt {
  my( $b, $cur ) = @_;
  my( $new, $d );
  my( $out ) = "";

  while( $cur ) {
    $new = int( $cur / $b );
    $d = $cur - $new * $b;
    if( $b == 256 ){ $d = chr( $d ); }
    elsif( $d >= 10 ) { $d = chr( ord("a")+$d-10 ) }
    $out = $d . $out;
    $cur = $new;
  }

  return $out;
}

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 16 May 1997 06:42:04 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: How to stop FOMAT putting space between fields?
Message-Id: <337c0035.9465426@news.ntr.net>

On Thu, 15 May 1997 09:13:22 -0400, Harold Todd Chapman
<chapman@techctr.buddcompany.com> wrote:

>format =
>GRID@>>>>>>>>>>>        @<<<<<<<@<<<<<<<@<<<<<<<
>$node,                  $x,     $y,     $z
>.
>
>The x/y/z vars are floating point numbers. I want them right next to
>each other but FORMAT seems to insist that there be a space. How can
>I prevent this.

Floating point numbers have the form [ -]\d*(\.\d+)?   (not counting
exponentials and other oddities)

The point is, the space is there so that negative numbers have a spot
to put their '-' without have a different number of places.
like this:

 3.1415926535
-3.1415926535

use the $x$y$z trick that was posted previously.
-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: Fri, 16 May 1997 04:11:02 -0600
From: aaronh@acm.org
Subject: Learn perl5 faster by using tcsh
Message-Id: <863773292.10496@dejanews.com>

#!/usr/bin/perl

<<'EOF';

addperldoc V0.99 -- http://members.tripod.com/~ah -- aaronh@acm.org

Creation history: Fri May 16 03:47:23 CDT 1997
   135  3:39    vi ~/bin/addperldoc
   136  3:41    addperldoc
   137  3:41    vi ~/bin/addperldoc
   138  3:41    addperldoc
   139  3:41    less ~/.perldoc
   140  3:41    vi ~/bin/addperldoc
   141  3:42    less ~/.perldoc
   142  3:42    addperldoc
   143  3:42    less ~/.perldoc
   144  3:42    vi ~/bin/addperldoc
   145  3:42    addperldoc
   146  3:42    sc
   147  3:42    vi ~/.complete
   148  3:42    vi ~/bin/addperldoc
   149  3:42    addperldoc
   150  3:43    complete perldoc    'n@*@`egrep ^$:1 $HOME/.perldoc`@'
   151  3:43    perldoc Getopt::Std
   152  3:43    perldoc integer
   153  3:43    h | less
Posted to Usenet: Fri May 16 04:00:55 CDT 1997
EOF

@dirs = (
  "/usr/local/lib/perl5",
  "/usr/lib/perl5"
);

foreach $dir ( @dirs ) {

  next if( ! -d $dir );
  print "Looking for .pm and .pod files in $dir\n";

  open( FOO, "( find $dir -name '*.pm'  -print ; ".
             "  find $dir -name '*.pod' -print ) |" );

  while( <FOO> ) {
    s@^$dir/@@;s@pod/@@;s@/@::@g;s@\.pm$@@;s@\.pod$@@;
    $output{$_} = 1;
  }

  close( FOO );
}

print <<'EOF';

Building $ENV{'HOME'}/.perldoc with possible arguments to perldoc.

Use builtin tcsh command

  complete perldoc    'n@*@`egrep ^$:1 $HOME/.perldoc`@'

to utilize this database

Also, visit my home page and/or drop me some e-mail...
http://members.tripod.com/~ah -- aaronh@acm.org

EOF

open( OUT, "> $ENV{'HOME'}/.perldoc" );

foreach ( sort keys %output ) {
  print OUT $_;
}

close( OUT );

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 16 May 1997 11:32:16 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: List of List Question I think (assigning LOTS of variables.)
Message-Id: <slrn5nohdq.m78.I-hate-cyber-promo@nessie.mcc.ac.uk>

In <337BBA6E.A429BAA8@fsc.fujitsu.com>,
	Hunter L. Brown <hunter@fsc.fujitsu.com> wrote:
>A. Deckers wrote:
>
>> 
>> There are really two issues here: (1) reading in the data, and (2)
>> storing it in a suitable data-structure for further manipulation.
[...]
>Alain,  Part (1) is done. I already have the data in a file delimited
>correctly. I can already read out each answer fine and split them all
>into variables, print them out, etc.

OK, we'll leave that to one side for the moment.

>> With regard to (2), you should look up the perllol and perldsc manual
>> pages, which explain how to create and manipulate List of Lists and
>> similar data-structures.
>
>I have and I just don't get it.

What don't you get? Did you try copying some of the examples given in
perldsc? What happens when you do? Does the compiler complain about
your script?

>Let me rephrase my question.  Forget
>everything else I have said. All I want to know is this.   
>
>What is the simplest way to do this:
>
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
>$QUESTION_1_A = "0";
[...]

I'm sorry, but I'm having some problems understanding exactly _what_ it
is you're trying to do. Maybe you want a list of hashes?

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

my(
	$i,
	$j,
	@loh,
);

for $i (1..10) {
	for $j ('a'..'f') {
		$loh[$i]{$j} = $i . '-' . $j;
	}
}

for $i (1..10) {
	for $j ('a'..'f') {
		printf "%5s ", $loh[$i]{$j};
	}
	print "\n";
}

__END__

Output:

  1-a   1-b   1-c   1-d   1-e   1-f 
  2-a   2-b   2-c   2-d   2-e   2-f 
  3-a   3-b   3-c   3-d   3-e   3-f 
  4-a   4-b   4-c   4-d   4-e   4-f 
  5-a   5-b   5-c   5-d   5-e   5-f 
  6-a   6-b   6-c   6-d   6-e   6-f 
  7-a   7-b   7-c   7-d   7-e   7-f 
  8-a   8-b   8-c   8-d   8-e   8-f 
  9-a   9-b   9-c   9-d   9-e   9-f 
 10-a  10-b  10-c  10-d  10-e  10-f 

HTH,

Alain

-- 
Perl information: <URL:http://www.perl.com/perl/>
        Perl FAQ: <URL:http://www.perl.com/perl/faq/>
    Perl archive: <URL:http://www.perl.com/CPAN/>


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

Date: 16 May 1997 10:48:48 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: MacPerl & Applescript
Message-Id: <86ohabx0nj.fsf@iis.ee.ethz.ch>

phenix@interpath.com (John Moreno) writes:
> Does anybody know how to get a perl variable passed along to
> AppleScript?
> 
> I'm trying to get applescript to pass along a url that I created with
> MacPerl to cyberdog
> 
> As a test I've been trying this:
> 
> $args = "Internet Using Freeppp";
> 
> MacPerl::DoAppleScript qq{
>         tell application "Script Editor"
>           choose file with prompt $args
>         end tell
> }
> 
> Can it be done?

Yes. Basically you have to keep in mind that the quotes are not part of the
value, so if you interpolate a variable, you usually have to put quotes around
it for it to make sense in AppleScript.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
     "Wirklich, ich lebe in finsteren Zeiten! // Das arglose Wort ist
      toericht. Eine glatte Stirn // Deutet auf Unempfindlichkeit hin.
      Der Lachende // Hat die furchtbare Nachricht // Nur noch nicht
      empfangen." -- Bertolt Brecht, _An die Nachgeborenen_


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

Date: Fri, 16 May 1997 07:55:15 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl & Applescript
Message-Id: <pudge-ya02408000R1605970755160001@news.idt.net>

In article <199705152326581462334@roxboro-168.interpath.net>,
phenix@interpath.com (John Moreno) wrote:

#$args = "Internet Using Freeppp";
#
#MacPerl::DoAppleScript qq{
#        tell application "Script Editor"
#          choose file with prompt $args
#        end tell
#}

Whoops.  You are sending the following command to Script Editor:

   choose file with prompt Internet Using Freeppp

But Script Editor doesn't know what Internet or using or Freeppp is.

          choose file with prompt "$args"
                                  ^     ^
Hope this helps,

--
Chris Nandor                 pudge@pobox.com                 http://pudge.net/
%PGPKey=('B76E72AD',[1024,'08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6'])
#=============================================================================
I have the oldest typewriter in the world.  It types in pencil.
                --Steven Wright
#=============================================================================


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

Date: Fri, 16 May 1997 13:12:27 +0200
From: Per Marstein <per.marstein@hda.hydro.com>
Subject: Q: Perl/Cgi under Windows NT
Message-Id: <337C411B.3CF3@hda.hydro.com>

I've installed a web server on a NT.

Unix uses the environment variable $QUERY_STRING to get the input from 
the client.

How to get the same information with a perl cgi-script ?

Per


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

Date: Fri, 16 May 1997 05:58:12 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regrex question - really basic!
Message-Id: <4kehl5.8s3.ln@localhost>

Ronald Fischer (rfi@uebemc.siemens.de) wrote:
: >>>>> On Thu, 15 May 1997 18:37:57 -0400
: >>>>> "John" == John Moreno <phenix@interpath.com> wrote:
: John> I am trying to do a extract a email address out of a string using a
: John> regular expression.
: John> 
: John> I'm using [^ <]+@[^ \r,>]+ which works as a regular expression.  The
: John> problem is getting this into a perl statement.

: Not sure if I understand your problem, but, provided the regexp is
: correct, and the string to be parsed is in $s, and the result should
: be put into $r, you could always write something like this:

:     $s =~ /(YourRegexpGoesHere)/ and $r=$1;
: $1 corresponds to the regexp in the first pair of parentheses.


It *might* correspond to the regexp in the parens. If it did not match,
then it will correspond to the *previous* regexp's successfully matched 
parens.

$r=$1 if $s =~ /(YourRegexpGoesHere)/;

is the usual idiom to avoid that problem.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 16 May 1997 11:44:48 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: regrex question - really basic!
Message-Id: <5lhhbg$3ag@pirate.shu.edu>

Hello -

tadmc@flash.net (Tad McClellan) writes:

>Ronald Fischer (rfi@uebemc.siemens.de) wrote:
>: >>>>> On Thu, 15 May 1997 18:37:57 -0400
>: >>>>> "John" == John Moreno <phenix@interpath.com> wrote:
>: John> I am trying to do a extract a email address out of a string using a
>: John> regular expression.
>: John> 
>: John> I'm using [^ <]+@[^ \r,>]+ which works as a regular expression.  The
>: John> problem is getting this into a perl statement.

>: Not sure if I understand your problem, but, provided the regexp is
>: correct, and the string to be parsed is in $s, and the result should
>: be put into $r, you could always write something like this:

>:     $s =~ /(YourRegexpGoesHere)/ and $r=$1;
>: $1 corresponds to the regexp in the first pair of parentheses.


>It *might* correspond to the regexp in the parens. If it did not match,
>then it will correspond to the *previous* regexp's successfully matched 
>parens.

>$r=$1 if $s =~ /(YourRegexpGoesHere)/;

>is the usual idiom to avoid that problem.

But wouldn't the 'and' short-circuit, preventing the assignment to
$r, with much the same effect as the 'if'?

I like the 'if' idiom better, anyway, but just wondering about the
logical difference.

David Black
dblack@icarus.shu.edu


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

Date: 16 May 1997 11:39:33 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: search and replace
Message-Id: <5lhh1l$l1o@news-central.tiac.net>

In article <337B771B.5C9C@escape.com>, Hans Gilde  <hansG@escape.com> wrote:
>Howdy all,
>
>	So, I'm doing a script which includes a function to recurse directories
>searching in the files, replaceing one string for another through out
>the whole file.  

Are you lookning for something to recurse through your directories or to
modify the files?  There is the File::Find module to help you with the
directory traversal.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 16 May 1997 12:06:53 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: search perl doku
Message-Id: <5lhikt$mjb@news-central.tiac.net>

In article <337BEDD4.2E2D6501@informatik.fh-hamburg.de>,
ms  <malcha_s@informatik.fh-hamburg.de> wrote:

>I search a book, reference or description about perl. 
>Has anybody a link or paper ?
>
>(I like the HTML format :-) )

  http://www.perl.com/perl/
  http://www.perl.org/

Are a couple of places to start, the perl manual page has a brief
description of perl and the FAQ (list of frequently asked questions) and
the Expert documentation written by Tom Christiansen should be considered
essential reading.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 16 May 1997 10:30:51 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Second attempt at problem (getting dynamic libraries to work with perl 5.003)
Message-Id: <5lhd0r$16d@pirate.shu.edu>

Hello -

John Bosch <jbosch@tid.cdscc.nasa.gov> writes:

>OK,
>	my last attempt came out all screwy so I'll try again. I've install
>perl 5.003 and enabled dynamic library support but can't get it to work.
>Initially I had a problem with the make not being able to find the
>library -ldl. When I remove this from the configuration all compiled
>fine. However, when I run a script that tries to do a 'use xxx' most of
>the libraries give the error below:

Assuming that this is the Red Hat 3.x problem, the fix is:

cd /lib
ln -s libdl.so.1.7.14 libdl.so

And then put -ldl back in your Perl configuration :-)

For some reason, Configure is happy with libdl.so.1, but the actual
linking fails unless you also have the libdl.so link.

David Black
dblack@icarus.shu.edu


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

Date: Fri, 16 May 1997 13:12:37 +0200
From: Martin Bernd Schmeil <schmeil@pixelpark.com>
Subject: something like cflow?
Message-Id: <337C4125.8BB@pixelpark.com>

are there any tools for perl like cflow for c? i have to deal 
with a few 100 perl scripts (different projects), none of them
documented, some requiring 'requires', some using modules, some
'producing' HTML-pages and forms. to get at least a hirarchical
overview of which function calls which would help a lot. especially
nice would be something that would also include the HTML-forms
which are calling the perl scripts.

sorry if this is a FAQ, i couldn't find something like that...

thanx for any help - tB!


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

Date: Thu, 15 May 1997 23:16:36 GMT
From: benh@hotmail.com (Future-NET)
Subject: Spy people on the Net
Message-Id: <337b9390.2878289@bang-olufsen.dk>

I present here my two most recent software which I hope they interest you.
they are progammed by Turbo C++ and run under Windows(3.11 and 95).
here is a short description of these two software.

1-Robot Spy 1.0
at my knowledge, this software is the first and the unique of its kind. 
This software allow you to spy your friends who are on the net at the same time
of you, it permits to see exactly what they do on their screen, pixel by pixel,
anywhere, in the world, at the condition they are connected to the internet.
how does-it work?
its simple, you send a file to the person you want to spy telling to him its a 
game or everythings else, the objectif is this person run the file. from this time,
a batch file is installed on his computor, and everytime this person use internet,
this batch connects him secretly on our server.
on your side, you , after the installation of the other part of the software every time
you want, you can connect on our server with your password and have the list of all the 
persons who received your batch and who are connected at this time. 
the only thing you have to do is to click on the name of the person you want to spy.
a window opens containing exactly the screen of the person spied, you can have
ten pictures per second with 256 colors, if you switch to balck and white mode you can
onbtain a real time sequence, approximatly 30 pictures by second.

Robot Mailer 1.1
The message you are reading presently  is sent to more then 20,000 newsgroups with 
this software. This program automates FreeAgent, and reach with a connection of 28,8 Kbauds
5,000 news per hours. It can also find a maximum of 50,000 e-mail adresses from  internet and
send a message in 4 or 5 hours.  You can obtain with this sofware the most powerful tool of
mass transmittion on the internet.

Robot Spy 1.0..................20 US$
Robot Mailer 1.1..............20 US$
Both..................................30 US$

Im sorry i cant accept credit card, but you can send an international money order to:

Ben Hedi Nassef
1481 Ste-Catherine est #7
Montreal, PQ, H2L-2H9
Canada

Dont forget to include your e-mail on a paper, you receice the software ordered in your
e-mail the day we receive the money order.



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

Date: Tue, 13 May 1997 11:32:26 -0500
From: Sarah Burcham <sarah@ecl.wustl.edu>
To: sdm <sdm@seas.upenn.edu>
Subject: Re: Undump Question...
Message-Id: <Pine.SOL.3.95.970513103139.6039h-100000@joplin.ecl.wustl.edu>

> I tried this with the undump (also on Solaris), and I couldn't get it to 
> work. It definitely will not work with Perl5, tho.
> Let me know if you get it to work!

So far no luck.  I gave up first on the TeX undump.  I couldn't find a
version of it for system V release 4, and didn't really care to rewrite
the undump I had found to work with the elf header libraries. 

I also tried compiling the GNU emacs unexec() into perl and passed it the
-DUNEXEC flag that perl is already equipped to handle, but no luck.  It
acts like it's working, but barfs halfway through the unexec telling me
that the .bss size has shrunk unexpectedly or some such nonsense.  I
assume the unexec works, since I was able to build GNU emacs and that's
how it builds itself.  I even tried the compile under Solaris 5.5.1 and
Solaris 5.4 and was testing it with the standard hello world program. 

<sigh> Guess I'm waiting until there's a beta of the compiler. 

// Sarah Elizabeth Burcham
// Engineering Computer Laboratories
// sarah@ecl.wustl.edu






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

Date: Fri, 16 May 1997 10:44:56 GMT
From: crossd@ln4d110swk.usenet (David Cross)
Subject: Re: What's the quickest way in perl to determine if a scalar is a list?
Message-Id: <CROSSD.97May16114456@ln4d110swk.usenet>

In article <esqu3k4prn3.fsf@nortel.ca> daku@nortel.ca (Mark Daku) writes:

> I'm looking for the FASTEST way to locate a string in an array. By
> fastest I mean in cpu not in code style.  I have a lot of arrays
> in my code I just want to speed up the validation.

Did you check the FAQ? You can find it at http://www.perl.com/perl/faq/
or posted on this newsgroup. Showing evidence of having read the FAQ is
about the fastest way to get on in this newsgroup :-)

>From the FAQ Section 4:

  How can I tell whether an array contains a certain element?

    There are several ways to approach this. If you are going to make this
    query many times and the values are arbitrary strings, the fastest way
    is probably to invert the original array and keep an associative array
    lying about whose keys are the first array's values.

        @blues = qw/azure cerulean teal turquoise lapis-lazuli/;
        undef %is_blue;
        for (@blues) { $is_blue{$_} = 1 }

    Now you can check whether $is_blue{$some_color}. It might have been a
    good idea to keep the blues all in a hash in the first place.

    If the values are all small integers, you could use a simple indexed
    array. This kind of an array will take up less space:

        @primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31);
        undef @is_tiny_prime;
        for (@primes) { $is_tiny_prime[$_] = 1; }

    Now you check whether $is_tiny_prime[$some_number].

    If the values in question are integers instead of strings, you can
    save quite a lot of space by using bit strings instead:

        @articles = ( 1..10, 150..2000, 2017 );
        undef $read;
        grep (vec($read,$_,1) = 1, @articles);

    Now check whether `vec($read,$n,1)' is true for some `$n'.

    Please do not use

        $is_there = grep $_ eq $whatever, @array;

    or worse yet

        $is_there = grep /$whatever/, @array;

    These are slow (checks every element even if the first matches),
    inefficient (same reason), and potentially buggy (what if there are
    regexp characters in $whatever?).

--
The Sybase Contractors' Resource Page
http://www.mag-sol.demon.co.uk/Sybase


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

Date: Fri, 16 May 1997 11:58:29 GMT
From: Magnus.Bodin@tychonides.se (Magnus Bodin)
Subject: Re: winnuke
Message-Id: <337e4bc9.588184474@news1.telenordia.se>

"Zachary Fisk" <fisk@homarus.ccsu.ctstateu.edu> wrote:

>Has anyone gotten the perl version of winnuke to work? I keep getting the
>following error:
>Undefined subroutine &main::sockaddr_in called at winnuke.pl line 6.
>Line 6 is:
>$in_addr = (gethostbyname($h))[4]; $in_addr = sockaddr_in($p,$in_addr);
>The whole script is below. I copied this script from:
>http://lisa.engelska.se/winnuke/info.html and have a made a few changes.
>
>thanks,
>
>Zach-
>

As stated:

Here is the source code, in PERL. I took one crucial line out, and
made a typo, which will be obvious to anyone who uses PERL, so as to
limit it's usefulness only to knowledgable people. This should run
under all UNIX's as well as Windows 95. 


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 487
*************************************

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