[8001] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1626 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 13 03:04:59 1998

Date: Tue, 13 Jan 98 00:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 13 Jan 1998     Volume: 8 Number: 1626

Today's topics:
     Re: Displaying GIFs - oops <patrick@mediacity.com.sg>
     Re: Displaying GIFs - oops (Martien Verbruggen)
     Displaying GIFs <patrick@mediacity.com.sg>
     Re: Displaying GIFs (Martien Verbruggen)
     Re: Displaying GIFs (brian d foy)
     Re: Getopt::Long caveat? (Johan Vromans)
     Re: Perl syscall on Irix 6.x (Martin Vorlaender)
     Re: Perl to Binary? (J. Bacon)
     Re: perl under windows95 <jbattikha@highsynth.com>
     PerlShop 3.1 setup question <openlinx@jps.net>
     Re: PerlShop 3.1 setup question (Martien Verbruggen)
     Re: PerlShop 3.1 setup question (Abigail)
     pipe, STDOUT, and STDERR (J. Bacon)
     Problems using Excel with ODBC as a database! <cr@mayers.de>
     Question on 5.005 merge (J. Bacon)
     Re: sending emails with perl ? <nospamhebert@nwlink.com>
     Re: Setting a time limit <perry@iway.fr>
     Re: Small Pattern Regrex Question? (John Irving)
     Re: Socket Help (Nathan V. Patwardhan)
     Re: truncating <aaronp@weirdness.com>
     Re: use File::Find;  ! on MacPerl  ? (Paul J. Schinder)
     Re: What does qw mean? <djacobs@tsoft.com>
     Re: Where do I get PERL <nospamhebert@nwlink.com>
     Re: Where do I get PERL (brian d foy)
     Why No Binary Distribution?  was Re: bison for perl <jdporter@min.net>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Jan 1998 13:14:17 -0800
From: Patrick Stacey <patrick@mediacity.com.sg>
Subject: Re: Displaying GIFs - oops
Message-Id: <34BBD929.5072@mediacity.com.sg>

sorry - the output should be at:

http://pat.mediacity.com.sg/adengine/test.pl

TIA

/pks


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

Date: 13 Jan 1998 05:46:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Displaying GIFs - oops
Message-Id: <69ev40$m25$3@comdyn.comdyn.com.au>

In article <34BBD929.5072@mediacity.com.sg>,
	Patrick Stacey <patrick@mediacity.com.sg> writes:
> sorry - the output should be at:
> 
> http://pat.mediacity.com.sg/adengine/test.pl

Just blank. How is it supposed to look?

You know... You really should give a bit more info.

- What is the expected behaviour?
- What does happen?

*sigh*
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au    | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: Tue, 13 Jan 1998 13:10:22 -0800
From: Patrick Stacey <patrick@mediacity.com.sg>
Subject: Displaying GIFs
Message-Id: <34BBD83E.23A9@mediacity.com.sg>

I have *nearly* got this working but not quite (common cliche).

Basically its to display an image in a browser. Heres the code:

#--START--#
 open(FILE, "c:\\webdocs\\adengine\\xmas.gif");
 binmode FILE;
 print "Content-type: image/gif\n\n";
 print <FILE>;
 close(FILE);
#--STOP--#

To see the output gott:
http://pat.mediacity.com.sg/engine/test.pl

TIA for any help!

Patrick Stacey


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

Date: 13 Jan 1998 05:43:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Displaying GIFs
Message-Id: <69euur$m25$2@comdyn.comdyn.com.au>

In article <34BBD83E.23A9@mediacity.com.sg>,
	Patrick Stacey <patrick@mediacity.com.sg> writes:

> I have *nearly* got this working but not quite (common cliche).

Nearly? What is the problem? What isn't it doing?

> Basically its to display an image in a browser. Heres the code:
> 
> #--START--#

Are you running perl with -w? Are you using 'use strict'?

>  open(FILE, "c:\\webdocs\\adengine\\xmas.gif");

- Even when your script is just an example, check the return code of
  open().
- Use / instead of \\, it's just neater.
- Use single quotes for stuff like this

open(FILE, 'c:/webdocs/adengine/xmas.gif') or die "Cannot open this thing";

>  binmode FILE;
>  print "Content-type: image/gif\n\n";

undef $/;

>  print <FILE>;
>  close(FILE);

> http://pat.mediacity.com.sg/engine/test.pl

Not Found

The requested object does not exist on this server. The link you
followed is either outdated, inaccurate, or the server has been
instructed not to let you have it.

> TIA for any help!

help for what? What is the question?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Tue, 13 Jan 1998 02:07:03 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Displaying GIFs
Message-Id: <comdog-1301980207030001@news.panix.com>
Keywords: just another new york perl hacker

In article <34BBD83E.23A9@mediacity.com.sg>, @mediacity.com.sg posted:

> I have *nearly* got this working but not quite (common cliche).

>  open(FILE, "c:\\webdocs\\adengine\\xmas.gif");
>  binmode FILE;
>  print "Content-type: image/gif\n\n";
>  print <FILE>;
>  close(FILE);

what happens when you try that from the command line?  do you get
all the image data of just a bit? (hint: why are you only reading
one line of input?)

   while( defined($line = <FILE> ) { print $line }

-- 
brian d foy                                 <http://computerdog.com>


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

Date: 13 Jan 1998 08:44:34 +0100
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: Getopt::Long caveat?
Message-Id: <wl3iuro95st.fsf@plume.nl.compuware.com>

fpostma@xs4all.nl (frans postma) writes:

> On 10 Jan 1998 06:10:30 GMT, darlenem@PAS.DE.SPAM.flash.net (Jeeves)
> wrote:
> 
> >use GetOpt::Long;

Getopt::Long, I presume.

> >%optctl = ( 'n' => \$num,);
> >&GetOptions(%optctl);
> ># lots_of_code
> >
> >Suppose the above snippet was run with '-n 10'. That's nice, $num
> >is now 10. But if no number is given? I cannot find an example of
> >this *anywhere* in the Camel book! I can only assume that it would
> >set $num to 1. But what if the script was run with 'n=1'? Am I
> >missing something? If not, how do I deal with that?
> 
> It's set to zero.

It is not set (defined) at all.
Of course this defaults to zero unless properly handled.

------------------------------------------------------------------------------
Johan Vromans                                             jvromans@squirrel.nl
Squirrel Consultancy                                  Haarlem, the Netherlands
http://www.squirrel.nl                  http://www.squirrel.nl/people/jvromans
PGP Key 2048/4783B14D   KFP = 65 44 CA 66 B3 50 0B 34  CE 0E FB CA 2D 95 34 D0
------------------------ "Arms are made for hugging" -------------------------


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

Date: Tue, 13 Jan 1998 06:17:34 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Perl syscall on Irix 6.x
Message-Id: <34baf8ee.524144494f47414741@radiogaga.harz.de>

Jarkko Hietaniemi (jhi@alpha.hut.fi) wrote:
: Last but not least: for what application do you need the syscall.ph?
: Using it should not be necessary for any modern application.

Net::Domain::_hostname() uses it (in an eval block) to "Try every
conceivable way to get hostname". This gets called e.g. from Net::SMTP
if you don't provide a hostname with the 'Hello' option.

As you might guess, I just ran into this - on an NT system (where
neither syscall.ph nor syscall.h do exist).

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 13 Jan 1998 02:25:49 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: Perl to Binary?
Message-Id: <69ejbd$b9i@dfw-ixnews10.ix.netcom.com>

In article <8coh1j4q43.fsf@gadget.cscaper.com>, merlyn@stonehenge.com says...
>
>>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
>
>Tom>  [courtesy cc of this posting sent to cited author via email]
>Tom> In comp.lang.perl.misc, jwbacon@ix.netcom.com (J. Bacon) writes:
>Tom> :There is a shareware Perl compiler available (cost is $35, it works on 
the 
>Tom> :ActiveState port build 3.13+ and has at least one 'bug').  
>
>Tom> I'm virtually certain that this is not a real compiler.  If
>Tom> it claims that, they're either prevaricating or I'm very
>Tom> highly confused.
>
>Well, it *is* a "compiler" in the sense of "bring together". :-)
>
>But certainly not at all what most people try to mean when they say
>compiler, nevermind that Perl has been a compiler even by that
>definition since 1987 with version 0.
>
<SNIP>
Sorry about the misrepresentation of 'compiler'.  merlyn@stonehenge.com is (as 
near as I can determine) COMPLETELY correct in the statement.  The product 
looks to me to be some sort of bundler, which allows a perl script to run 
without the Perl binary already installed on the target machine.

Still, it produces a (huge!) file which runs as a standalone executable.



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

Date: Tue, 13 Jan 1998 00:10:37 -0500
From: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: perl under windows95
Message-Id: <34BAF74D.B5F444A8@highsynth.com>

cwtalbot@intellex.com wrote:

> I already tried that.  The screen flashes with black page and a one line
> message, but the exlporer screen returns before I can read the message. I
> changed the program to print several lines to force the page to stay
> longer, but that didn't work.  The one line that is displayed must be an
> error message of some kind, but it disappears before I can read it.

*chuckle*

That's because when Perl is done sending to SDTOUT (the console), it
exits.  There is no reason to stick around.  If you want to see the
output, try opening a DOS window and type "perl yourscript.pl" at the
command line.  If you haven't placed perl.exe in your environment's
PATH, you'll need to fully qualify the path to the executeable (and the
script as well since it's probably not located in your perl's bin
directory).

For example, type
c:\perl\bin\perl.exe c:\perl\scripts\yourscript.pl

Another thing you can try (if you don't like typing in DOS prompts) is
forcing Perl to stick around with the following 2 lines at the end of
your sript:
print "Done. Hit any key to exit...";
$exitscript = <STDIN>;

-- 
Jihad Battikha
jbattikha@highsynth.com
http://www.highsynth.com


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

Date: Mon, 12 Jan 1998 21:35:52 -0800
From: J Kim <openlinx@jps.net>
Subject: PerlShop 3.1 setup question
Message-Id: <34BAFD37.D5AB981B@jps.net>

First, let me explain my setup.

Under ~myuserid/public_html/cgi-bin/MyStore,
there are PerlShop.cgi (script iteset) and directories (catalog,
customers,
log, orders, temp_customers, temp_orders, tokens).

And I did not change PerlShop.cgi's directory variables for those
sub-directories above mentioned.

I put page1.html (I am trying to setup the same demo as arpanet.com
provides) under catalog subdirectories.
My HTML tag of "enter shop" is <input TYPE=hidden name=thispage
value="page1.html">.

THe problem is when I enter the shop PerlShop.cgi script iteself
shows up instead of page1.html.

Any guess/tip/soulution to above problem?

P.S. My ISP server would allow "<form method=post>", so I am using
"<form method=get>"




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

Date: 13 Jan 1998 05:50:27 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PerlShop 3.1 setup question
Message-Id: <69evb3$m25$4@comdyn.comdyn.com.au>

[Newsgroups: comp.lang.perl.modules,comp.lang.perl,comp.lang.perl.misc]

[comp.lang.perl is long dead. If your news server still has it, let
your admin know that it doesn't exist anymore.]

[This has nothing to do with modules. comp.lang.perl.modules removed.]

In article <34BAFD37.D5AB981B@jps.net>,
	J Kim <openlinx@jps.net> writes:

> THe problem is when I enter the shop PerlShop.cgi script iteself
> shows up instead of page1.html.

Server misconfiguration, contact your admin.

> P.S. My ISP server would allow "<form method=post>", so I am using
> "<form method=get>"

What sort of nonsensical restriction is that?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: 13 Jan 1998 07:19:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PerlShop 3.1 setup question
Message-Id: <69f4in$hnq$1@client3.news.psi.net>

J Kim (openlinx@jps.net) wrote on 1596 September 1993 in
<URL: news:34BAFD37.D5AB981B@jps.net>:
++ First, let me explain my setup.

First, let me explain that comp.lang.perl has been dead for years.

++ Under ~myuserid/public_html/cgi-bin/MyStore,
++ there are PerlShop.cgi (script iteset) and directories (catalog,
++ customers,
++ log, orders, temp_customers, temp_orders, tokens).

Yada, yada, yada.


Where is the *perl* question?



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 13 Jan 1998 02:47:24 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: pipe, STDOUT, and STDERR
Message-Id: <69ekjs$b9i@dfw-ixnews10.ix.netcom.com>

Last week I spent some of my copius free time fooling around with piping the 
STDOUT of a program called from Perl straight into the Perl program.  Got that 
running just fine!  THEN I fed the program (a real live DOS program, 16 bit) 
an intentional error and 'everything hung' because the called program output 
to STDERR.

Is there a way to collect the called process output from either or both 
handles?  My environment is (mostly) Win95 machines, ActiveState's latest 
greatest, and all the other usual drawbacks.

I resorted to using 'system("program.exe > C:\\result.txt");', which works 
fine, but requires subsequent file opens, reads, and unlinks, and the 
possibility of picking an already used name (however obscure), and so forth.

-- 
***** Give me ambiguity or give me something else. *****
Jim Bacon
jwbacon@ix.netcom.com
303-666-9455 (H)  303-581-9635 ext. 329 (W)



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

Date: Tue, 13 Jan 1998 17:03:39 +1300
From: Christian Roth <cr@mayers.de>
Subject: Problems using Excel with ODBC as a database!
Message-Id: <34BAE79B.1360CCA0@mayers.de>

Hi Folks,

does anybody know why I can't get any Information, neither a error
message out of my excel sheet?
I designed a test.xls with 4 colomns and a few rows.
Something like: A   B   C   D
		1   1   1   1
		2   2   2   2
		5   5   5   5

I made all the necessary configurations in my ODBC part.

Here my script:

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";

use Win32::ODBC;
$db = new Win32::ODBC("test");

if (!($db = new Win32::ODBC($db))){
    print "Error connecting to $db.\n";
    print "Error: ".Win32::ODBC::Error()."\n";
    exit;
}

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs) {
	($name, $value) = split(/=/, $pair);
	#Split the pair up into individual variables.
	$name =~ tr/+/ /;
	$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	$value =~ tr/+/ /;
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	$FORM{$name} = $value;
    }

$action = $FORM{'action'};
$keyword = $FORM{'keyword'};
$search = $FORM{'search'};

print "<html><head><title>HERA Database Entries</title></head>\n";
print "<body>\n";
print "<center>\n";
print "<table border=0>\n";
print "<tr><td bgcolor=#9C9C9C><b>A</b></td><td
bgcolor=#9C9C9C><b>B</b></td><td bgcolor=#9C9C9C><b>C</b></td>
<td bgcolor=#9C9C9C><b>D</b></td><td
bgcolor=#9C9C9C><b>E</b></td></tr>\n";

if ($action eq "showall") { &showall; }
	else { &search; }

sub showall {
    $rc = $db->sql("SELECT DISTINCT * FROM test order by A");

    $count = 0;

    while ($db->fetchrow) {
	    $a = $db->Data(A);
	    $b = $db->Data(B);
	    $c = $db->Data(C);
	    $d = $db->Data(D);

            $count = $count + 1;

	    print "<tr><td><font size=2>$a</font></td><td><font
size=2>$b</font></td><td><font size=2>$c</font></td>
<td><font size=2>$d</font></td><tr>\n";
    }
}

print "</table>\n";
print "<p>\n";
print "</center>\n";
print "<font size=2>Number of matches: $count</font>\n";
print "<p><a href=\"../hera_members.html\"><font size=2>another
search</font></a>\n";
print "</body></html>\n";

$db->Close


All I get out of it is the title row.
Can anybody tell me where my data is please?

Christian

http://www.mayers.de/~cr

4 Olive Cres
Papatoetoe, Auckland
New Zealand

Tel.: +64-9-278 4810
Fax bei HERA: +64-9-262 2856


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

Date: 13 Jan 1998 02:58:24 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Question on 5.005 merge
Message-Id: <69el8g$b9i@dfw-ixnews10.ix.netcom.com>

When the moment we are all (NT/95 users) are waiting for arrives and the two 
Perls merge:  does anybody have a good idea (SWAG or better) on how much 
modification existing scripts will need to run on the 'merged' flavor?

My particular situation relies heavily on Aldo Calpini's Win32::API module, 
and to a lesser extent his Win32::Console.  The Console.pm stuff I would give 
up for the "GUI" stuff in G Saranthy's port, but without the API I am set back 
about 4-6 months.

The reason I bring this up is because I picked Perl as being VERY portable, 
which it seems to be, and well 'supported' as well, and all the other good 
stuff.  However, those of us who are not using Perl for its "practical 
extraction and reporting" capabilities might be looking at what I found with 
Microsoft C 7.0 when Windows 95 came out -- the frozen library syndrome, at 
least for a period of time.

-- 
***** Give me ambiguity or give me something else. *****
Jim Bacon
jwbacon@ix.netcom.com
303-666-9455 (H)  303-581-9635 ext. 329 (W)



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

Date: 13 Jan 1998 06:58:42 GMT
From: "jch" <nospamhebert@nwlink.com>
Subject: Re: sending emails with perl ?
Message-Id: <01bd1ff0$b60d9f00$1c8714d1@nwlink.com>

If you are on a UNIX server use mail-lib.pl if you are on NT use
smtpmail-lib.pl
you can get both of these at http://selena.mcp.com/scripts
both include install instructions.
memeier@bene.baynet.de wrote in article
<34b92f7c.5684565@news.uni-erlangen.de>...
> Hi !
> Can anybody tell me how send emails with perl-scripts ?
> 
> 
> Mike
> 


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

Date: Mon, 12 Jan 1998 11:33:56 +0100
From: Pascal PERRY <perry@iway.fr>
Subject: Re: Setting a time limit
Message-Id: <34B9F194.63EA@iway.fr>

Patrick-James H. Dionisio wrote:
> 
> Is there a way in Perl to set a time limit on running shell programs?
> Let's say I'd like a script to allow a program 30 seconds to
> execute, terminate the program and then move on.
> 
> I'm using Perl 5.001 on WinNT and it looks like the alarm function
> is not supported in this version.  Anybody know if later versions
> support alarm or has another way of setting time limits?
> 
> Thanks in advance.
> 
> -->Patrick

  Instead of alarm use multi-thread capabilities of perl.

  -----------------------------------------------------------------
  use Win32::Process;
  Win32::Process::Create($ProcessObj, ...);
  ...
  $ProcessObj->Wait($time) || print " Time exceeded!\n";
  # $time could be INFINITE or 30s for instance
  -----------------------------------------------------------------

  Go and see Win32 process help (html) supplied with perl lib.

  --
  Pascal PERRY


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

Date: Tue, 13 Jan 1998 05:32:58 GMT
From: hyperc@magma.ca (John Irving)
Subject: Re: Small Pattern Regrex Question?
Message-Id: <hyperc-1301980032100001@206.191.12.213>

In article <dmge96.pc4.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

>John Irving (hyperc@magma.ca) wrote:
>
>: Can anyone tell me why the following doesn't match?
>
>: $Query = '(?i)and maintained.|(?i)other patterns|(?i)etc.';
>: $Data = 'and maintained.';
>
>: print "\n\nQuery is: $Query";
>
>: if ($Data =~ /\b($Query)\b/) {
>                          ^^
>                          ^^
>:       print "\nResult is: $& matches";
>:     } else {
>:       print "\nResult is: No Match";
>:     }
>
>: # why doesn't 'and maintained.' match?
>
>
>Because \b matches between a \w and a \W char (or vice versa).
>
>The end of the string is taken as a \W char.
>
>So it does NOT match between the dot and the end of the string since
>they are both \W characters...
>

Tad,

The problem is that there may be many different patterns
(one|two|three|etc) some which might not end in a period. I currently have
a variable $wb which is '\b' or nothing depending on the users choice of
options. 

eg:    

if ($full_matches) {$wb = '\b'; }

if ($case_sensitive) {$case_op = '(?i)'; }

foreach $Query (@User_submitted_Queries) {
   $patterns_to_match .= "$case_op$Query\|";
        }

if ($Data =~ /$wb($patterns_to_match)$wb/) {
yada, yada...

I'm trying to build the regex's dynamically as much as possible. Anyone
have any suggestions?

Thanks to all that replied via email.

Thanks,

John
hyperc@magma.ca


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

Date: 13 Jan 1998 03:58:42 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Socket Help
Message-Id: <69eopi$pcf@fridge.shore.net>

John Kotwicki (Webmaster@csa.clpgh.org) wrote:
: I am looking for code examples that will help me out with the 
: following problem:  I want to be able to retreive a file from a Web 
: site and save it to a local directory.  

If you get the NT port of Perl by Sarathy, it's bundled with LWP --
this includes the GET script that will do what you want without (you)
having to write your own client.  If you already have NTPerl by
ActiveState, I'm not sure, but I've heard that there's a patched
version of LWP floating around.  Someone should correct me here.

: Everyone tells me that it is really easy, all I have to do is use a 
: socket connection, yet I have never actually seen this done.  Has 
: anyone ever done this successfully?  BTW:  I am using NT 4.0 

Yes, I've been able to write a client that does this under
NTPerl5.003_07 (and you really can if you're feeling ambitious), but
the test was just to see how the NTPerl sockets stuff was coming
along.  :-)

--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov


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

Date: Tue, 13 Jan 1998 00:55:51 -0500
From: "Aaron C. Paulley" <aaronp@weirdness.com>
Subject: Re: truncating
Message-Id: <69evl7$nu$1@usenet52.supernews.com>

>
>File::Basename module would be best. It will work across different
>Operating Systems.
>
>
>To do it non-portably:
>
>   $filename = $1 if m#.*/(.*)$#;
>


So the line:

$filename = $fullfilename if m#.*/(.*)$#;

would take the variable $fullfinename which = "/usr/bin/local/filename.txt"
and create a new variable ($filename) that would = "filename.txt"  ?

I would test it, but my server's FTP access is down for upgrades today.

Thanks!




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

Date: Mon, 12 Jan 1998 20:50:23 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: use File::Find;  ! on MacPerl  ?
Message-Id: <schinder-1201982050250001@schinder.clark.net>

In article <34baa167.32302900@news.ice.net>, defike@ilstu.edu..spam.not wrote:

}  Help!
}  I was just introduced to File::Find and was happy.  About as happy as
}  when I was introduced to associative arrays.  Now I wrote a couple of
}  quick scripts on NT and Unix using File::Find and I am still happy.
}  But...When I tried to run from a Mac using MacPerl I get the following
}  errors;
}  
}  "use" may clash with future reserved word
}  
}  syntax error next 2 tokens "use File"
}  
}  "find" may clash with future reserved word
}  
}  Now here is the script OI would like to be running;
}  
}  #!perl -w
}  use File::Find;
}  find (&Wanted, 'Macintosh HD:Desktop Folder:vicki")
}  sub Wanted
}   {
}    print "$File::Find::name\n";
}   }
}  
}  
}  What I am trying to do is rename Macintosh files with illegal
}  characters prior to moving them to Windows.  My script worked well
}  when I ran it from Win95 or AIX but the files need to be renamed on
}  the Mac.
}  Could someone point out why I can't run this with MacPerl???

If I fix your syntax errors and make a change for my machine:

#!perl -w
use File::Find;
find (\&Wanted, 'The Black Pits:Desktop Folder:');
sub Wanted
 {
  print "$File::Find::name\n";
 }

this runs fine for me with MacPerl 5.18r4.


}  
}  TIA
}  Don
}  defike@ilstu.edu..spam.not

-- 
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov


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

Date: 13 Jan 98 02:25:00 GMT
From: Doug Jacobs <djacobs@tsoft.com>
Subject: Re: What does qw mean?
Message-Id: <34bad07c.0@news.tsoft.net>

Cameron Dorey <camerond@mail.uca.edu> wrote:
> Mark666769 wrote:
> >
> > use CGI qw(:standard);
> > 
> > It's just the syntax - what exactly does "qw" mean in the syntax
> > of Perl? "Learning Perl" doesn't cover it, and I couldn't find
> > it in the faq.

> I'd be _real_ surprised if the Llama doesn't cover it, because LPoW32S
> (the Gecko) has it in Chapter 3, "Arrays and List Data." 

Well, it says what it does, but what does "qw" mean?  

Analogy:  cat is short of "conCATenate" but qw...?  ("quote word"?)

Just curious...that's all.


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

Date: 13 Jan 1998 06:47:26 GMT
From: "jch" <nospamhebert@nwlink.com>
Subject: Re: Where do I get PERL
Message-Id: <01bd1fef$22af4ac0$1c8714d1@nwlink.com>

if you are looking for perl for a winNT server go to www.activestate.com
if you are looking for perl for a UNIX server get any book on perl and it
will come with it.

Bob Macpherson <calban@ime.net.au> wrote in article
<01bd1fcc$c4828740$6736df81@blackhole>...
> There are many entries around the net about PERL but I cannot find one
that
> tells me where I can get it, or am I missing something here.
> 
> regards,
> 
> Bob
> 
> calban@ime.net.au
> 


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

Date: Tue, 13 Jan 1998 02:08:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Where do I get PERL
Message-Id: <comdog-1301980208380001@news.panix.com>
Keywords: just another new york perl hacker

In article <01bd1fef$22af4ac0$1c8714d1@nwlink.com>, "jch" <nospamhebert@nwlink.com> posted:

> if you are looking for perl for a winNT server go to www.activestate.com
> if you are looking for perl for a UNIX server get any book on perl and it
> will come with it.

not every book on Perl comes with perl source, although it's not
difficult to get it from CPAN <URL:http://www.perl.com>.

-- 
brian d foy                                 <http://computerdog.com>


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

Date: Mon, 12 Jan 1998 17:04:56 -0500
From: John Porter <jdporter@min.net>
Subject: Why No Binary Distribution?  was Re: bison for perl
Message-Id: <34BA9388.474E@min.net>

Zenin wrote:
> 
> John Porter <jdporter@min.net> wrote:
> : Well, sure, anyone can make anything available if they want to.
> : Is that official enough to be called a "perl distribution"?
> 
>         Why not?  It's a "Perl Binary Distribution".

There basically two sources for perl: CPAN and "other".  You can guess
which one I prefer to get my Perl from.


> : > They kind of have to for solaris, as Solaris doesn't bloody come
> : > with a C compiler standard! :(
> : So? As long as gcc is available, you don't need binaries... at least
> : for the common unix flavors (including Solaris).
> 
>         You're assuming that every piece of software has perfect makefiles
>         that work out of the box on every Unix system, every compiler, and
>         every version and combination of them.

I am assuming no such thing.  Although my argument does extend to
software
generally, I am really talking about Perl.  Perl is an example of well-
maintained, well-ported code; not perfect, I realize, but how wonderful
it
would be if all software distributions were as portable as Perl...

It's also fairly common for software distributions to only support the
GNU
C compiler.  If the vendor is able sell enough of their own compiler, 
support for that may come along.  If their compiler is too abnormal,
maybe
the software distributor will stick with just supporting gcc.  What's
the 
problem?

More importantly, it is far better to assume that the Makefile in the
distribution works with the Make on my system, rather than to assume
that 
the binary I got from WinWhizzWare runs flawlessly.
In the former case, I can dink with the Makefile and rebuild; in the
latter,
I am just plain stuck. Guess I could submit a bug report...


>         If you've been around any
>         length of time, you'd know the world is just not that nice and it's
>         vary oftin you'll need to tweak the makefile or even the source code
>         itself to work correctly or even to just compile at all.

I have been around a long time, and I do know.
I am well acquainted with the frustration of trying to install software
which was developed by a guy who had only a Spartan 5 running Mueslix
0.93 
with a K&R compiler and GW-Make 1.0.  But at least I can dink with the
Makefile he supplied.

>         It would
>         be nice if all these tweaks get folded back into the standard
>         release, but the sad fact is that they don't for many different
>         reasons.

Surely.  So you admit that many tweaks are necessary to be able to 
compile and run a software package on the myriad different systems out
there; good.  Do you propose that the distributor precompile for each
of those configurations, and make the binaries available?

>         Once the binary is created however, it often works fine
>         on many combinations.

Other gurus might not share your optimism.  Take a look
at the installation notes, and you'll get an idea why it is very unwise
to
think that a Perl binary compiled on my Solaris 2.5.1 machine will "just
work"
on your Solaris 2.5.1 machine.  The number of actual permutations is
much
too large, at least for Unix.  For Win32, this number may be small
enough...

The "Acquiring Perl Software" page on Perl.com says, in part:

    Binary Distributions
    Binaries are not available for native systems. For a lot of reasons, 
    it's really much better if you configure and build Perl yourself.
Anyway, 
    it's contrary to the open and inquisitive spirit of Perl, the
Internet, 
    and software freedom to pass around potentially viral binaries that
people 
    can't open up and look at, fix up, learn from, rewrite, and simply
enjoy 
    for the pure sense of coding fsthetics. If your vendor didn't
provide 
    you with a C compiler, you will need to get a binary version of gcc
to 
    bootstrap.

>         On some systems there are standard sets of "adjustments" for most
>         pieces of software that allow for source level installs with most
>         if not all of the "tweaking" done for you already.  FreeBSD does
>         a *great* job of this with its /usr/ports system, but not all
>         other venders are so friendly.

I am always amazed at how good a job the Perl Configure script does at
deducing the peculiarities of my system.

>         BTW, how do you get gcc with out a C compiler or a "binary"
>         distribution of gcc...?

I can think of a couple routes to a solution; can you?

>         You do know that gcc (and most of the entire GNU utility set) works
>         under Win32, right?  So with the logic above why would anyone need
>         to distribute binaries for perl packages?

Taking ActiveState's example, they distribute the source, as well as
binaries
for two hardware platforms (Intel and Alpha).  Their port works only on
Win95 
and NT 3.5/newer, not on Win32s or on NT versions older than 4.0. 
In other words, even distributing two binaries, they still don't cover
the 
range of possible Win32 platforms.  So I agree with the PGs that
distributing
the sources is a Good Thing.

John Porter
jporter@logicon.com


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

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

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