[15938] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3351 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 14 03:05:41 2000

Date: Wed, 14 Jun 2000 00:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960966314-v9-i3351@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 14 Jun 2000     Volume: 9 Number: 3351

Today's topics:
        A Question? Net::Ping not returning anything? tiny samp <robert@chalmers.com.au>
    Re: ANSI Perl: No Way !!! <care227@attglobal.net>
        distributing perl modules, programs <pants@brutal.com>
    Re: Easy CGI question <godzilla@stomp.stomp.tokyo>
    Re: evaluating expressions (Tad McClellan)
    Re: Extract filename from path? <henrik.jonsson@se.adtranz.com>
    Re: Extract filename from path? <lr@hpl.hp.com>
    Re: FileHandle simulation within a script? (Tad McClellan)
        funny Documentation?? <engan@cmdmail.amd.com>
    Re: grep - a beginner question (Tad McClellan)
    Re: Help with strings (Tad McClellan)
        How to use LWP::UserAgent to get a zip file? <tonywu@sonix.com.tw>
    Re: how to write on a file? (Tad McClellan)
    Re: how to write on a file? <uri@sysarch.com>
    Re: how to write on a file? (Tad McClellan)
    Re: IP address help... (Steve Leibel)
    Re: Larry Rosler interview on perl.com! <care227@attglobal.net>
    Re: Perl and .htaccess <trevor@trevorsky.com>
        Perl Resources <damonNOdaSPAM@unispace.com.invalid>
        Perlmagick and CGI bann3094@my-deja.com
    Re: putting a sub into seperate file (Tad McClellan)
    Re: Source Filter implementation <rootbeer@redcat.com>
    Re: Source Filter implementation <rootbeer@redcat.com>
    Re: Source Filter implementation (Eric Smith)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 14 Jun 2000 14:18:07 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: A Question? Net::Ping not returning anything? tiny sample program.
Message-Id: <YGD15.181$W74.3583@nsw.nnrp.telstra.net>

I'm trying to figure why the following code doesn't return anything?
No errors, nothing. The ip is the machine it's running on. ??
Does anyone have any ideaas please?
thanks
Robert
 ...................................
#!/usr/local/bin/perl -w
$host = '203.1.96.6';

use Net::Ping;

    $p = Net::Ping->new();
    print "$host is alive.\n" if $p->ping($host);
    $p->close();
 ..................................




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

Date: Wed, 14 Jun 2000 01:18:43 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <394715B3.A480DA2@attglobal.net>



Jerome O'Neil wrote:
> 
> It's highly entertaining, watching people poke you.
> 
> You are our very own state machine!  What can we make you
> do next?

I keep having the sneaking suspicion that there is some NG somewhere
full of folks laughing there asses off.  Kinda like when the folks
from alt.discordia go trolling in the atheist groups.


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

Date: Tue, 13 Jun 2000 22:36:31 -0700
From: Harrison Page <pants@brutal.com>
Subject: distributing perl modules, programs
Message-Id: <394719DF.98B2829F@brutal.com>

Hello,

I have a clump of homegrown scripts and modules that performs a useful
task. The path to Perl and other details (paths to libraries, preferred
temporary directory, etc.) are hard-coded across the files. What is the
best way to distribute these and have the user go through a
configuration process where I would prompt them (or find) their perl,
their CGI directories, their library paths. Typically is Perl software
distributed with a Makefile.PL and I would roll my own scripts here? 

Thank you,

N. Starbuck
pants @ alcyone.com


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

Date: Tue, 13 Jun 2000 21:10:58 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Easy CGI question
Message-Id: <394705D2.84FB76CF@stomp.stomp.tokyo>

Eric Bohlman wrote:
> 
> Dan Sugalski (dan@tuatha.sidhe.org) wrote:
> : Larry Rosler <lr@hpl.hp.com> wrote:
> : > In article <JXv15.1436$My2.2834@news1.rdc1.ct.home.com> on Tue, 13 Jun
> : > 2000 19:28:41 GMT, Dan Sugalski <dan@tuatha.sidhe.org> says...

> : >> The line endings are also wrong--per the HTTP spec it's supposed to be
> : >> CRLF pairs, not bare linefeeds.

> : > That should be taken care of by the server, when transmitting the header
> : > to the client.

> : No reason not to get it correct. If you're going to be taking control of
> : the HTTP conversation, even partially, the data sent should be correct.
 
> But the bare linefeeds *are* correct terminators for *CGI* headers.
> Unless the script is running NPH, it's outputting CGI headers, not HTTP
> headers, and the CGI spec allows bare linefeeds.  The set of CGI headers
> is *almost* isomorphic to that of HTTP headers, but there's definitely a
> mapping that the server is supposed to perform (for example, certain
> Location: CGI headers are supposed to signal the server to output an
> alternate document rather than issuing a Location: HTTP header).
 
> Remember that you're dealing with two separate interfaces here: the CGI
> interface between the script and the server, and the HTTP interface
> between the server and the user agent.


I can verify what you say to be absolutely correct, Mr. Bohlman.
Doesn't matter if you are running straight cgi or nph-cgi.
Almost all of my programs are non-parsed header cgi programs.
Some are standard cgi programs. Regardless, I use bareline
\n\n for content type, location... Works perfect and, you 
are precisely and exactly right, nph or not. Your advice 
is very sound. Don't allow the less experienced to brow 
beat you with smelly mule manure.


Godzilla!


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

Date: Tue, 13 Jun 2000 23:59:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: evaluating expressions
Message-Id: <slrn8ke0pc.39i.tadmc@magna.metronet.com>

On Wed, 14 Jun 2000 03:51:30 GMT, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

>  G> $w = (10+3*$x-$x**2);
>
>do you understand the difference between a string and a perl expression?
>obviously not. you don't have the following line ANYWHERE in your code
>so your doesn't address his query at all. just the usual lack of
>comprehension on your part. some english phd who can't even follow a
                             ^^^^^^^^^^^^^^^^

She is not an English PhD.

Everything you see in the movies is not true, heh heh.


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


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

Date: Wed, 14 Jun 2000 07:51:38 +0200
From: Henrik Jönsson <henrik.jonsson@se.adtranz.com>
Subject: Re: Extract filename from path?
Message-Id: <dxxHOSKv38IFqfAvA86v1oGX3+8I@4ax.com>

I think I found a simpler solution myself:

sub basename {
  my ($path) = @_;
  my (@fileList);
  
  @fileList = split(/\\|\//, $path);
  @fileList = reverse @fileList;
  
  return $fileList[0];
}

/henrik


On Sat, 10 Jun 2000 02:26:35 GMT, elephant@squirrelgroup.com (jason)
wrote:

>Larry Rosler writes ..
>>You probably meant this:
>>
>>      $pfad =~ s;\\;/;g;   # change all \ to /
>>
>>which is better writen this way:
>>
>>      $pfad =~ tr%\\%/%;   # change all \ to /
>>
>>which is faster.  Using ';' as a regex delimiter is masochistic, as you 
>>see.
>>
>>>     return substr($pfad,rindex($pfad,'/')+1);
>>> }
>>
>>There are many other ways to do this, including a simple regex such as:
>>
>>    /([\\/]+)$/
>>
>>And the module File::Basename, to include other oddities such as the 
>>Mac.
>
>not to mention the fact that 'c:filename.ext' is a valid Win32 absolute 
>filename .. and while File::Basename copes with this as expected - this 
>little regex doesn't



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

Date: Tue, 13 Jun 2000 23:24:22 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Extract filename from path?
Message-Id: <MPG.13b0c4f4d907cd6998ab6f@nntp.hpl.hp.com>

In article <dxxHOSKv38IFqfAvA86v1oGX3+8I@4ax.com>, 
henrik.jonsson@se.adtranz.com says...
> I think I found a simpler solution myself:
> 
> sub basename {
>   my ($path) = @_;
>   my (@fileList);
>   
>   @fileList = split(/\\|\//, $path);
>   @fileList = reverse @fileList;
>   
>   return $fileList[0];
> }

Simpler yet (same method):

  sub basename { (split m%[\\/]% => shift)[-1] }

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


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

Date: Tue, 13 Jun 2000 21:39:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: FileHandle simulation within a script?
Message-Id: <slrn8kdoj0.36i.tadmc@magna.metronet.com>

On Wed, 14 Jun 2000 00:48:16 GMT, Chovy <johndoyle33@hotmail.com> wrote:

>I want to append this to the previous value of $print_links...any
>suggestions?


Use the concatenation operator:

   $print_links .= 'some more stuff appended after the other stuff';


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


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

Date: Tue, 13 Jun 2000 22:59:00 -0700
From: Mike Engan <engan@cmdmail.amd.com>
Subject: funny Documentation??
Message-Id: <Pine.GSO.4.21.0006132220380.7446-100000@olympus>


All the documentation for system and exec that I find states that they
inherit the parent enviroment. Specificly Chapter 16.2 Running
Another Program in the Oreilly "Perl Cookbook" sep98 edition. Page
555. 

--quote--
    You want to run another program from your own, pause until the
other program is done, and then continue. The other program should
have same STDIN and STDOUT as you have. 
--end quote--


Yet,

  If you take two differnet machine. Run the server on one. Set that
name in the test_client program and then run the client. 

 This is an example where I am trying to set the STDOUT to be used by
the system or exec. But the system call dumps to the server tty. not
the client tty, and I would think, and want it to do. 

Does anyone know why this is happening, and how i can get this to work
right? Please respond to me directly. 

mike.engan@amd.com

-----program------test_server--
#!/usr/local/bin/perl
# FILE: test_server
use strict;
use IO::Socket;
use POSIX qw(:sys_wait_h);
my $port=101010;
my ($pid,$client,@data,$temp);
my $eof="EOF_EOF";

my $server=IO::Socket::INET->new(LocalPort => $port,
				Type => SOCK_STREAM,
				Reuse => 1,
				Listen => 10 )
	or die "Could not be a tcp server on port $port: $@ \n";

while($client=$server->accept()){
  $client->autoflush(1);
  next if $pid = fork;          #### parent returns to while to wait for next
				#### connection
  die "fork: $! " unless defined $pid;
  print "starting to read from client\n";
  while($temp=<$client>){
    print "   $temp\n";
    if($temp =~ /$eof/){
      last;
      }
    else{
      chomp($temp);
      push(@data,$temp);
      }
    }
  print "data : @data\n";
  select($client);		### this sets my socket to the client
  *STDOUT = $client;		### as the default out, then I set
				### STDOUT to the same file handle
  print $client "  1)printing to client works\n";
  print         "  2)client set to default\n";
  print STDOUT  "  3)STDOUT is set to the client\n";

  ### If you comment out the exec, the later code will not get called. 
  ###exec(@data);
  system("@data");
  print STDOUT  "  4)STDOUT is again on the client, but you did not see the data did you?\n";
  close($client);
  exit;
  }
----------------------------


-----program-------test_client------
#!/usr/local/bin/perl
# FILE: test_client
use Text::ParseWords;
use IO::Handle;
use IO::Socket;
use strict;

my ($host,$kidpid,$handle,$line);
my ($addr,$paddr,@str);
my $eof="EOF_EOF";
my $string="echo \"mem > 100 && hello world\"";
my $port=101010;

#### To try this your self set this to a machine
#### that you are running test_server on
my $host="lsfmaster2";


@str = shellwords($string);
print "Running over to another machine to execute string!!!\n";
$addr=inet_aton($host) or die "no host\n";
$paddr=sockaddr_in($port,$addr) or die "Hey can't pack\n";
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die "Sockets: $! \n $@ \n";
SOCK->autoflush(1);
connect(SOCK, $paddr) or die "Can not connect to $host:$port : $!\n $@ \n";
print STDERR "Connected to $host\n";
die "can't fork: $!" unless defined($kidpid = fork());
if($kidpid){
  while(defined ($line=<SOCK>)){
    print STDOUT $line;
    }
  kill("TERM" => $kidpid);
  }
else{
  SOCK->autoflush(1);
  print SOCK "$string\n";
  print "$string\n";
  print SOCK "$eof\n";
  print "$eof\n";
  print "I just send the command!\n";
  }
----------------------------------------



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

Date: Tue, 13 Jun 2000 21:38:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: grep - a beginner question
Message-Id: <slrn8kdoh1.36i.tadmc@magna.metronet.com>

On Tue, 13 Jun 2000 20:40:09 -0500, karlh <karlh@midco.net> wrote:

>I am trying to learn how to use grep in a Perl program and have written
>the following to experiment with.
>
>@array = ("Bob Stands Tall", "Sarah Sits Still", "Mary Runs Slowly");
>
>print "Search for: ";
>$search = <>;
>chomp $search;
>
>@arrayout = grep($_ = $search, @array);
                  ^^^^^^^^^^^^

That is an assignment statement.

You are _replacing_ the string from @array with the search string there.


>I want the last print line to print the array fields which contained the
                                                            ^^^^^^^^^
>search string.


I think you were trying to test for equality, but now you just
want to know if it is "contained" or not.


You must use the correct operator.

= is assignment, not what you want.

== tests for equality as numbers

eq tests for equality as strings

index() can find a substring in a larger string.

So can a pattern match:

   @arrayout = grep( /$search/, @array);


>For example, when I enter "Tall" for a search string, the print output
>is, "Tall Tall Tall". I do not know what this is.


The value of an assignment is the value assigned.

So "$_ = $search" will be whatever the value of $search is.

Looks like you were assigning "Tall", which is not one of
the false values, so it gets included in grep's result list.


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


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

Date: Tue, 13 Jun 2000 23:56:47 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with strings
Message-Id: <slrn8ke0jv.39i.tadmc@magna.metronet.com>

On Wed, 14 Jun 2000 03:24:35 GMT, Mike Ray <noone@nowhere.org> wrote:

>I have a problem with string comparisons which has me climbing the
>walls. I've exhausted all I can think to do to resolve the problem(s).


Did that include "use strict" and -w?


>Help would be much appreciated. My environment is Perl 5.004 on Unix.
>The code that is giving me problems is as follows:
>
>for( $k = 0; $k <= $#PLines; $k++) {
>    if ($PLines[$k] =~ /FORMNAME/) {
>        $PLines[$k] =~ /=(.+?)\]/;
>        if ($Form{'FORMID'} eq $1) {          #THIS LINE ALWAYS FAILS


You should *never ever* use the dollar-digit variables unless
you first test to see if the match succeeded.

They are only updated if the match succeeds. If it fails, they
will have whatever they had in them before the pattern match.


>In the above code, the hash element $Form{'FORMID'} is being filled in
>by cgi-lib.pl


Oh. This is a CGI program. 

You should have said that up front. Information about the
environment that you are using Perl in may be relevant to
the problem you are experiencing.


cgi-lib.pl is awfully old code.

use CGI.pm instead.


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


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

Date: Wed, 14 Jun 2000 15:39:54 +0800
From: "§dªF½å" <tonywu@sonix.com.tw>
Subject: How to use LWP::UserAgent to get a zip file?
Message-Id: <8i7al2$1ehg$1@news.is.net.tw>

Hi:

    The following Perl Script can get an HTML page, but if I use the same
script
to get a zip file, the zip file format is not correct. Does anyone know how
to use
LWP::UserAgent to get a zip file? Thanks a lot.

use LWP::UserAgent;
my $ua = new LWP::UserAgent();

$ua->agent("Mozilla/3.0");

my $req = new HTTP::Request("GET" => $command);

$req->header("Accept" => "text/html");

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

if ($res->is_success)
{
     open( OUT, "> yahoo.html" );
     print OUT $res->content();
     close( OUT );
}






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

Date: Tue, 13 Jun 2000 21:51:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how to write on a file?
Message-Id: <slrn8kdp9g.36i.tadmc@magna.metronet.com>

On Tue, 06 Jun 2000 23:20:54 -0700, The_tick <the_tickNOthSPAM@inet.net.nz.invalid> wrote:

>Here is how you write to a file:


No it isn't!

You have 3 bugs, 1 portability problem, and 1 misleading cue.


>open(FILE,"location/to/file.txt");


You should always, yes *always*, check the return value from open():

   open(FILE, 'location/to/file.txt') || 
      die "could not open 'location/to/file.txt' $!";


Use single quotes for constant strings.


>flock(FILE, 2);

You should check the return value there too.

You should import the constants. Hard-coding them is non-portable.


>print FILE "text goes here";


This is the only line of code that is OK.


>flock(FILE, 8);


You should never ever do this. Just close() the file.

You have _created_ a race condition! The purpose of file locking
is to avoid race conditions. Your attempt to make it better has
made it worse instead.


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


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

Date: Wed, 14 Jun 2000 04:42:01 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how to write on a file?
Message-Id: <x7ya487u1z.fsf@home.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:

  TM>       die "could not open 'location/to/file.txt' $!";
                                                       ^^

  TM> Use single quotes for constant strings.

that is not a constant string, though i agree with your view here.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 14 Jun 2000 01:36:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how to write on a file?
Message-Id: <slrn8ke6fl.3s1.tadmc@magna.metronet.com>

On Wed, 14 Jun 2000 04:42:01 GMT, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
>
>  TM>       die "could not open 'location/to/file.txt' $!";
>                                                       ^^
>
>  TM> Use single quotes for constant strings.
>
>that is not a constant string, 


And it is not in single quotes either.


_those_ single quotes are another thing. I like to have 
delimiters around filenames in diag messages (I even do
it when the filename is not variable :-)


>though i agree with your view here.
                               ^^^^


I was talking about the single quotes in the open(), the
"misleading cue" that I had mentioned earlier.

So I guess you agree with my view _there_  :-)


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


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

Date: Tue, 13 Jun 2000 21:23:53 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: IP address help...
Message-Id: <stevel-1306002124220001@192.168.100.2>

In article <duB15.701$Uw3.33951@bgtnsc04-news.ops.worldnet.att.net>,
"PictureFactory" <PictureFactoryr@worldnet.att.net> wrote:

> Is there a Perl function to resolve an IP like
> 24.10.125.132   into   130.atlanta-41-and more details...
> Or could you point me to a script that does that?

gethostbyaddr


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

Date: Wed, 14 Jun 2000 01:11:21 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <394713F9.3996BB26@attglobal.net>



Henry wrote:

> > My point is that millions of newbies are able to comprehend
> > things far beyond what you are willing to give them credit for.
> 
> My opinion is base on first-hand personal experience.  It is regretful
> that this does not conform with your perspective of reality.

Accross the hall from me sits a theoretical physicist.  I spent the 
day discussing relativity and the possibility that matter can escape
a black hole.  My brain is oozing.  My perspective of reality is,
therefore, stuffed.


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

Date: Tue, 13 Jun 2000 21:28:30 -0700
From: "Trevor Sky Garside" <trevor@trevorsky.com>
Subject: Re: Perl and .htaccess
Message-Id: <yND15.143$C02.78014@news.pacbell.net>

"Bob Tate" <btate@primary.net> wrote in message
news:1GC15.3868$bc4.262822@news1.primary.net...
> I am trying to find out if there is a way in Perl to provide a website
user
> to a secured website using .htaccess procedures to be able to "Logoff" by
> clicking a button.  This would remove the reference stored in memory of
the
> browser to be removed so that if the user were to click "Refresh" they
would
> be asked again to provide the user name/password as if it was there first
> time.
>
> Anyone know if this can be done and how?
>


If this can be done, it is not with Perl.  Perhaps a CGI header or something
of the like.  You'd probably get some good ideas if you asked in
comp.infosystems.www.authoring.cgi

--Trevor




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

Date: Tue, 13 Jun 2000 23:11:39 -0700
From: damonr <damonNOdaSPAM@unispace.com.invalid>
Subject: Perl Resources
Message-Id: <0d811636.6dcb7e0c@usw-ex0105-036.remarq.com>

Hi,

I am running a new site(http://www.devcritic.com) and i was
wondering if you people knew some good Perl resource sites that
i could add to the Perl part of the site directory:
http://www.devcritic.com/sites/Perl/. Feel free to add any sites
by clicking "Add a site" on the side menu or tell me here and i
will add em to there.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Wed, 14 Jun 2000 06:10:54 GMT
From: bann3094@my-deja.com
Subject: Perlmagick and CGI
Message-Id: <8i77l6$8ad$1@nnrp1.deja.com>

Hello,

I am using perlmagick to manipulate images.  The problem that I am
having is that when I run the script from the command line the script
works fine, but if I run the script as a CGI, perlmagick cannot find the
images. The image files and the directories  have the correct
permissions.

If anybody can help me I would gretly appreciate it.

Roger,

Enclosed is a sample script that tries to read images from a directory,
but fails:

#!/opt/local/bin/perl

use Image::Magick;
$image1 = Image::Magick->new(magick=>'jpg');

opendir(IMGDIR, "/res/w3sllim/www/cgi-bin/imgdb/temp") ||
      die("Unable to open directory");
@files = readdir(IMGDIR);

print "Content-type: text/html\n\n";
foreach $file (sort @files) {
     next if (($file == '\.') || ($file == '\.\.'));
    $image1->Set(filename=>"/res/w3sllim/www/cgi-bin/imgdb/temp/$file");

    $xx = $image1->Read();
    print ("$xx:$file\n");
}

exit 0;

Error Message:

Warning 315: no delegates configuration file found (delegates.mgk) [No
such file or directory]
Warning 320: no delegate for this image format
(/res/w3sllim/www/cgi-bin/imgdb/temp/296.jpg)
Warning 320: no delegate for this image format
(/res/w3sllim/www/cgi-bin/imgdb/temp/422.jpg)


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 13 Jun 2000 23:28:56 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: putting a sub into seperate file
Message-Id: <slrn8kduvo.36i.tadmc@magna.metronet.com>

On Tue, 13 Jun 2000 21:17:00 GMT, Daniel van den Oord <danielxx@bart.nl> wrote:
>I want to put some big standard working Subroutines inro another file so It
>isn't in the main cgi anymore.. I can do that with require or use right ????


What happened when you tried it?


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


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

Date: Tue, 13 Jun 2000 20:27:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Source Filter implementation
Message-Id: <Pine.GSO.4.10.10006132024560.18837-100000@user2.teleport.com>

On 13 Jun 2000, Eric Smith wrote:

>              #tr/n-za-mN-ZA-M/a-zA-Z/
>               &replacerot
>                 if ($status = filter_read()) > 0 ;

Your sub (&replacerot) should probably modify $_ , just as the tr/// which
it replaces. To be sure, it's generally best to write that sort of thing
as something like this:

    $_ = &replace_rot $_
	if ....

I think that, if you fix your sub to accept a parameter and return a new
filtered string, you'll have what you want. Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 13 Jun 2000 20:40:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Source Filter implementation
Message-Id: <Pine.GSO.4.10.10006132038150.29369-100000@user2.teleport.com>

On 13 Jun 2000, Eric Smith wrote:
>              #tr/n-za-mN-ZA-M/a-zA-Z/
>               &replacerot
>                 if ($status = filter_read()) > 0 ;

Since tr/// modifies $_ , your replacement should do the same. It's
generally best to write that sort of thing something like this:

    $_ = &replace_rot($_)
	if ....

If you fix your sub to accept a string as a parameter and return a
filtered string, this should work for you. Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Jun 2000 06:52:55 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: Re: Source Filter implementation
Message-Id: <slrn8keau6.bub.eric@plum.fruitcom.com>

Tom Phoenix posted
 > On 13 Jun 2000, Eric Smith wrote:
 > >              #tr/n-za-mN-ZA-M/a-zA-Z/
 > >               &replacerot
 > >                 if ($status = filter_read()) > 0 ;
 > 
 > Since tr/// modifies $_ , your replacement should do the same. It's
 > generally best to write that sort of thing something like this:
 > 
 >     $_ = &replace_rot($_)
 > 	if ....
 > 
 > If you fix your sub to accept a string as a parameter and return a
 > filtered string, this should work for you. Good luck with it!

You are correct - thank you. (And those parens round the last $_ are required).


-- 
Eric Smith
eric@fruitcom.com


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3351
**************************************


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