[18306] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 474 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 12 21:06:00 2001

Date: Mon, 12 Mar 2001 18:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984449114-v10-i474@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 12 Mar 2001     Volume: 10 Number: 474

Today's topics:
    Re: $ENV{'HTTP_REFERER'} <sdfg@asd.g>
    Re: $ENV{'HTTP_REFERER'} <brondsem@my-deja.com>
    Re: 405 Method not Allowed <comdog@panix.com>
        Assigning string from between two patterns? <bglass@pgtv.com>
    Re: CGI question <peter.sundstrom-eds@eds.com>
        CGI.pm redirect() behavior change? (Karl Wiebe)
        CPAN question <klacquement@syscor.com>
        Does a merge function exist? <lfoss@myxa.com>
        form to second form and auto  submit using perl scripti <impressn54@aol.com>
    Re: form to second form and auto  submit using perl scr <sdfg@asd.g>
    Re: Formatting HTML using Perl <phibeta@newsguy.com>
    Re: Formatting HTML using Perl <iltzu@sci.invalid>
    Re: functions, operators and () <peter.sundstrom-eds@eds.com>
        Getopt::Std question <bmccann@naisp.net>
    Re: How do I delete (ignore) part of a string? <pigpen@easynews.com>
    Re: How do I delete (ignore) part of a string? <bart.lateur@skynet.be>
        How to retrieve files from remote computers via Netware <ryanc@nci1.net>
    Re: HTTP_WEFERER ???? <sdfg@asd.g>
    Re: Pass in variables to web page <peter.sundstrom-eds@eds.com>
    Re: Perl And CGI <thomasj@europa.com>
        preserve unix path when obtaining parameters from uploa <hugo@fractalgraphics.com.au>
    Re: Reading and writing files <bmb@ginger.libs.uga.edu>
    Re: Reading and writing files (Jay Tilton)
        reg exp question (zawy)
    Re: reg exp question <DNess@Home.Com>
    Re: reg exp question <wyzelli@yahoo.com>
    Re: reg exp question <wuerz@yahoo.com>
        SSI Help... <brian@brianracer.com>
    Re: SSI in CGI? <sdfg@asd.g>
    Re: Tk based alarm clock (Phil Ehrens)
    Re: Typeglob assignment confusion <peter.sundstrom-eds@eds.com>
    Re: Typeglob assignment confusion <james@NOSPAM.demon.co.uk>
    Re: Why glob doesn't take a list? (Ilya Zakharevich)
    Re: Why glob doesn't take a list? <bart.lateur@skynet.be>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Mar 2001 23:27:30 GMT
From: "S51" <sdfg@asd.g>
Subject: Re: $ENV{'HTTP_REFERER'}
Message-Id: <CXcr6.79158$UZ4.19895700@news4.rdc1.on.home.com>

"Richard" <rworth5@home.com> wrote in message
news:QQ9r6.3609$rB2.288054@news1.rdc1.mb.home.com...
> Unfortunatley I have already thought of that, but there is no change.
Since
> it is spelled the exact same way in many other scripts, as well as in the
> books I have. The spelling should not affect this.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach (sort keys %ENV)
{
    print "$_=$ENV{$_}<BR>\n";
}

If you don't see HTTP_REFERER then it doesn't exist. Your program shouldn't
blindly assume any variable exists unless it created and defined it, use
exists(). Also note that if you call the script through your webserver by
typing it into the location you won't get a referer (or it will be blank).


LKembel




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

Date: Tue, 13 Mar 2001 01:10:44 GMT
From: "Dave Brondsema" <brondsem@my-deja.com>
Subject: Re: $ENV{'HTTP_REFERER'}
Message-Id: <oser6.53271$W05.10585673@news1.rdc1.mi.home.com>


"Richard" <rworth5@home.com> wrote in message
news:uT4r6.3278$rB2.271347@news1.rdc1.mb.home.com...
> I am wondering if anyone else is having a problem with this. I have had a
> line of code on my script for the past 3 months. It has been working just
> fine until about a week ago. I havent changed anything, and noticed for
some
> unknown reason, it has stopped working.
>
> All I am doing is keeping a log of the referring pages.
>
> I have even tried something as simple as
>
> $name = $ENV{'HTTP_REFERER'};
>
> print "$name\n";
>
>
> and it won't even do that. I can get everyother environment variable to
> print to screen except this inparticular.
>
> Was hoping someone could explain.
>
> Richard
>
>

Referer returns the name of the page that linked (or similar) to the current
page.  When testing, make sure you test by linking from one webpage to the
perl script.

--
Dave Brondsema




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

Date: Mon, 12 Mar 2001 19:07:53 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: 405 Method not Allowed
Message-Id: <comdog-B43767.19075312032001@news.panix.com>

In article <98jeuk$ncq$1@news.netmar.com>, brichards@cda.com wrote:

> What does this error mean?  When calling to SoapLite.com the client works. 
> But when I connect to my server I get SOAP call failed.

it means that the HTTP method is not allowed.  which method method is
the user-agent trying to send?

-- 
brian d foy <comdog@panix.com>



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

Date: Mon, 12 Mar 2001 23:30:17 -0000
From: Brian Glass <bglass@pgtv.com>
Subject: Assigning string from between two patterns?
Message-Id: <taqn098060vh65@corp.supernews.com>

I am trying to create a script which will read the contents of an external 
text file and extract a string from between two regular patterns within 
that file. The text file is set up with data as follows:

<tag>data string</tag><tag2>another data string</tag2>

I need to be able to extract the text 'data string' and assign it to a 
scalar variable. 

I've had no problems opening the file and printing the contents, but 
cannot figure out the expression for extracting only the data between the 
two patterns ('<tag>' and '</tag>').

Oh yeah, the server is an NT box, if that makes any difference. Thanks in 
advance for your help!

-Brian

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Tue, 13 Mar 2001 11:58:38 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: CGI question
Message-Id: <98jkba$ttk$1@hermes.nz.eds.com>


"Gabe Rother" <rother@nortelnetworks.com> wrote in message
news:3AACEFD0.1BD8FD9E@nortelnetworks.com...
> There is no line like that.  It's a cgi script created by AnalogX, and I
> can't modify the exe file.  There is a config file, but it doesn't show
> anything like that.  Here it is:
>
> BASEURL
> FILESPEC
> FILESPEC
> SEARCHPATH
> SKIPLIST
> EXCLUDEPATH
> EXCLUDEPATH

So why did you post a CGI question to clpm?




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

Date: 12 Mar 2001 15:24:21 -0800
From: karl@mars.dnai.com (Karl Wiebe)
Subject: CGI.pm redirect() behavior change?
Message-Id: <98jlr5$dt5$1@mars.dnai.com>

OK, I've read PerlFAQ 9.10, the perldoc CGI, various articles via
groups.google.com, etc., but I can't find an explanation for
this change. Yes, I know can just print a "Location:" header by hand,
but am wondering if anyone (Lincoln?) knows the reason it ceased
to work.

I have the following grotty nph CGI script that I've used without
a hitch for some time now under an old version of CGI.pm (2.36).
I put it on another server with CGI.pm 2.752, and the same code
fails to redirect the browser ("Document contains no data," which
will be clear from the -debug output below).

Here's the script, nph-rwhois.cgi:

#!/usr/bin/perl

use CGI qw/fatalsToBrowser -debug :standard/;

$q = new CGI;

if(!$q->param()) {
        print $q->start_html('RWHOIS lookup, using www.rwhois.net'),
        $q->h1('RWHOIS Lookup'),
        $q->start_form,
        "IP Address ", $q->textfield('ip'), $q->p,
        $q->submit,
        $q->end_form,
        $q->hr;
} else {
        $url = "http://www.rwhois.net/perl/prwhois.cgi?url=rwhois://rwhois.arin.
net:4321/auth-area=0.0.0.0/0&query
=" . param('ip');
        print $q->redirect(-uri => $url, -nph => 1);
}

exit 0;

Here are the (working) headers generated from the command line:

% ./nph-rwhois.cgi ip=208.201.239.56
HTTP/1.0 302 Found
Status: 302 Found
Uri: http://www.rwhois.net/perl/prwhois.cgi?url=rwhois://rwhois.arin.net:4321/au
th-area=0.0.0.0/0&query=208.201.239.56
Location: http://www.rwhois.net/perl/prwhois.cgi?url=rwhois://rwhois.arin.net:43
21/auth-area=0.0.0.0/0&query=208.201.239.56
Content-type: text/html
 
% perl -MCGI -e 'print $CGI::VERSION . "\n";'
2.36

Here's the new (and broken) output:

% ./nph-rwhois.cgi ip=208.201.239.56
HTTP/1.0 302 Moved
Server: cmdline
Status: 302 Moved
Date: Tue, 13 Mar 2001 20:11:45 GMT
location="http://www.rwhois.net/perl/prwhois.cgi?url=rwhois://rwhois.arin.net:43
21/auth-area=0.0.0.0/0&amp;query
=208.201.239.56"

% perl -MCGI -e 'print $CGI::VERSION . "\n";'
2.752

Thoughts? Comments? Name of the FM to R? Thanks.

--Karl
-- 
        == Karl Wiebe == karl@dnai.com ==
"Order is a form of repetition compulsion" --Freud
"Order is a form of repetition compulsion" --Freud
"Order is a form of repetition compulsion" --Freud


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

Date: 12 Mar 2001 15:18:22 -0800
From: Kevin Lacquement <klacquement@syscor.com>
Subject: CPAN question
Message-Id: <m2ae6qh8zl.fsf@aridhol.syscor.priv>

Hello, all

I have recently mirrored CPAN on my machine.  Is there an easy way to
install everything?  How about a way, within the CPAN shell, to get a
list of uninstalled modules to install?

Also, if it is possible, is there a reason why I shouldn't do this?

Cheers,
Kevin

-- 
He that breaks a thing to find out what it is has left the path of
wisdom                                         -- Gandalf the Grey


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

Date: Mon, 12 Mar 2001 18:16:45 -0500
From: Lloyd Foss <lfoss@myxa.com>
Subject: Does a merge function exist?
Message-Id: <3AAD58DD.6E04EB9C@myxa.com>

The problem is I am combining several timestamped logfiles together 
and need the combined file to be in order.  The dirty solution is 
to use sort:

@results = sort @log_1_contents, @log_2_contents, ... @log_N_contents;

However the logs are already in order so sort is inefficient.  I would 
really like to merge the rather than sort.  Something on the order of:

@results = merge {merge_function} \@log_1_contents, \@log_2_contents...

The 'merge function' would be similar to sort's 'sort function' execpt 
it would be a min or a max of the top element of each array in the
list of array references rather than a compare.

Has such a function been written?  Or something similar available?

If not I will write it but I would prefer to not reinvent the wheel.

Thanks ahead of time,

-- 
Lloyd Foss Jr
Myxa Corporation
lfoss@myxa.com


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

Date: Mon, 12 Mar 2001 15:38:16 -0800
From: "Jae Yang" <impressn54@aol.com>
Subject: form to second form and auto  submit using perl scripting
Message-Id: <taqna7o2nlnf27@corp.supernews.com>

I was wondering if anyone of you can help me on this.  I would like to write
a script which passes variables from
one form to another form with an "AUTOSUBMIT" process.  I don't want the
users seeing where they are submitting to.
It seems quite easy but I just can seem to get the autosubmit part.  any
help would be greatly appreciated.

Jae Yang
impressn54@aol.com






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

Date: Mon, 12 Mar 2001 23:46:29 GMT
From: "S51" <sdfg@asd.g>
Subject: Re: form to second form and auto  submit using perl scripting
Message-Id: <pddr6.79225$UZ4.19918356@news4.rdc1.on.home.com>

"Jae Yang" <impressn54@aol.com> wrote in message
news:taqna7o2nlnf27@corp.supernews.com...
> I was wondering if anyone of you can help me on this.  I would like to
write
> a script which passes variables from
> one form to another form with an "AUTOSUBMIT" process.  I don't want the
> users seeing where they are submitting to.
> It seems quite easy but I just can seem to get the autosubmit part.  any
> help would be greatly appreciated.

Not sure what this has to do with perl per se...

If the 2nd form supports GET then print your form data in the query string
that you'll return to the client within a Location header.

Or have your server submit the data, which allows you to POST it as well. I
think the LWP module is what you want, search cpan.org.


LKembel




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

Date: Mon, 12 Mar 2001 17:01:27 -0800
From: Nuet Lareton <phibeta@newsguy.com>
Subject: Re: Formatting HTML using Perl
Message-Id: <t1sqat4hk68bkd91jjk38d0p0alg266mn1@4ax.com>

On Mon, 12 Mar 2001 16:18:44 -0600, "Michael D. Kirkpatrick"
<wizard@psychodad.com> wrote:

>Nuet Lareton wrote:
<snippage>
>> Thanks guys.
>> Nuety

>A typical HTML editor like Claris Home Page or Hot Metal will
>automatically format the HTML that way.  Check it out...

Yeah, I have Homesite and FP (yech) and they both do codesweepers of a
sort, but I wanted to see the perl method of doing it. Mostly as an
exercise on if I could write it or on using methods and Modules. I
know the mantra of perl is that there are a million ways of doing even
the simplest tasks, I would like to see if what I described would be
going in the right direction or to look at a module and see the guts
of it and see how it handles the job. Then find a way to apply it to
the situation. I have been working like a bugger to try to learn perl.
=)

Nuety


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

Date: 13 Mar 2001 00:28:49 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Formatting HTML using Perl
Message-Id: <984443153.20236@itz.pp.sci.fi>

In article <gafqatkojk1ednngij52qmum13p3pbir2h@4ax.com>, Nuet Lareton wrote:
>Hi! I'm somewhat new to perl and I'm a little lost on something I
>wanted to do. I want to format all the HTML documents in a folder the
>same way. Mostly for neatness and to creat a template file.

This isn't a Perl solution, nor does it exactly match your
specification, but you really should look into HTML Tidy:

  http://www.w3.org/People/Raggett/tidy/

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla / Kira -- do not feed the troll.


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

Date: Tue, 13 Mar 2001 11:52:21 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: functions, operators and ()
Message-Id: <98jjvh$t5u$1@hermes.nz.eds.com>


"Alun Moon" <alun.moon@unn.ac.uk> wrote in message
news:uelw3z4sn.fsf@unn.ac.uk...
> I had a discussion with a colleague about teaching Perl.
>
> Initially the students would be taught to use something like
>
>   print("hello world\n");
>
> Where I would use
>
>  print "hello world\n";
>
> I believe that the use of () alters the way the print handles the
> parameters.  I've read through the Perldocs (perlfunc) and page 77 in
> the Camel book.
>
> My understanding is that the () make the print a function rather than
> a list operator (though I'm not sure what the distinction is), and
> alter the precidence of the statement.  Am I right?
>
> I also advocated that we teach the
>   print "hello world\n";
> version, as this is the form used in the perldocs and Camel book.
> Does this seem right?

Why are you asking this again?  Did you like the answers you got to this
question a couple of weeks ago?




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

Date: Mon, 12 Mar 2001 19:25:20 -0800
From: "Brian McCann" <bmccann@naisp.net>
Subject: Getopt::Std question
Message-Id: <taqqeie70md139@corp.supernews.com>

Hi,

With Getop why is it that I don't have to explicitly declare $opt_a (is this
variable built in to Perl?)
but I have to declare $tag with my, I tried replacing $opt_a with $tag like
this

if ( defined( $tag ) ) {

but the compiler complained that $tag needed to be declared,
it seems a round about way to get a value for $tag from the command line, by
first assigning it to $opt_a,  then
to assign $tag the value of $opt_a.



The way I would like the script to run is, if I want a tagged build I'll
pass the script getopt.plx the switch -t
and the tag I want to build e.g. PCS-1-0-0-Build1, and if I don't want a
tagged build just run the script without
a switch ( something tells me though that I should have a switch for nightly
build otherwise the script wont know
where to start).

c:\getopt.plx -t PCS1-0-0-Build1

tia
Brian


use warnings;
use strict;
use Getopt::Std

Getopt::Std::getopts( 'a:');
if ( defined( $opt_a ) ) {
   print "-a flag set to $opt_a\n";
   my $tag = $opt_a;
   print "The value of tag is: $tag\n";

}


If you wish to unsubscribe, send an e-mail to:
perl-ntadmins-unsubscribe@topica.com

____________________________________________________________
T O P I C A  -- Learn More. Surf Less.
Newsletters, Tips and Discussions on Topics You Choose.
http://www.topica.com/partner/tag01





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

Date: Tue, 13 Mar 2001 01:32:04 GMT
From: "Nancy" <pigpen@easynews.com>
Subject: Re: How do I delete (ignore) part of a string?
Message-Id: <oMer6.24329$v47.948568@news.easynews.com>

"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrn9apgou.sip.tadmc@tadmc26.august.net...
> Nancy <pigpen@easynews.com> wrote:
>
> >Sorry Tad, didn't try yours.
>
>
> I misunderstood the question anyway.
>
>
> >I should have prefaced my post with the fact
> >that I'm not a programmer.  I am modifying a very good off-the-shelf
script.
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Those are extremely rare.
>
> Since you are not a programmer, how do you arrive at the conclusion
> that it is "very good"?

The programmer doesn't use Flash on his site web site.

> There are many many freely available scripts that are poor. Not
> robust, security holes, etc...

Actually, I ponied up the $15.00 registration fee (only after I was sure I
could butcher it up to my liking).

> Which one did you grab? Where did you get it? Maybe someone with
> more experience will critique it for you.

Merchant Order Form V 1.5. http://www.merchantorderform.com/  Very well
documented package.  I am modifiying it to provide instant, on-line quotes
(and ordering) for commercial printing.  The handling of credit card numbers
is a bit iffy, but we won't be using that, all our creditcard orders will be
handled through pay-pal (or similar service).

> >I first looked through the FAQ at
>                                 ^^
> >http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq4.html
>
>
> You do not need to go web surfing to find the very same file that
> is already on your hard disk, just use the one that came with your
> perl distribution:

While this should have been obvious to me, and I've seen many references to
it here, it never sunk in till now.  This will save a great deal of time
over the coming years.  Thanks for the pointers.

>    perldoc perlfaq4
>
> For searching the FAQs on your hard disk:
>
>    perldoc -q <search term>
>
> To find out how to use perldoc:
>
>    perldoc perldoc
>
>
> >I usually do pretty good figuring out what I need.
>
>
> The standard docs that come with perl will help a lot with that,
> perldoc is your friend.
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas




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

Date: Tue, 13 Mar 2001 01:53:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How do I delete (ignore) part of a string?
Message-Id: <m1vqatkpjvco1m7pc6pp281t9v0vqm8nke@4ax.com>

James Taylor wrote:

>>    perldoc perlfaq4
>
>Personally I find it very helpful when someone posts a URL because I
>don't have a working perldoc on my system.

The docs are also available online on the web, through various sources.
On CPAN, for one. On language.perl.com. And, on Activestate's website.

	<http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq4.html>
	<http://language.perl.com/newdocs/pod/perlfaq4.html>

<http://velocity.activestate.com/docs/ActivePerl/lib/Pod/perlfaq4.html>

Simply typing in "perlfaq4" in Google brought me there.

-- 
	Bart.


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

Date: Mon, 12 Mar 2001 20:05:54 -0500
From: "Ryan Carrier" <ryanc@nci1.net>
Subject: How to retrieve files from remote computers via Netware?
Message-Id: <98jrk8$sus$1@taliesin.netcom.net.uk>

This may sound simple to some, but...here goes:

On our corporate intranet, we have an NT 4 machine running IIS that we use
as our main web server. We also have a couple of machines that serve as
central file servers, using Netware. I've developed an interface in which
users request AutoCAD drawings from within the web server.

I now need to be able to retrieve documents from one of the file servers. I
think one of my options is to map a drive letter on the web server to the
file server. Is there another way (module or socket?)  to access files on a
separate machine on the same network? (I know the IP of the machine).





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

Date: Mon, 12 Mar 2001 23:38:06 GMT
From: "S51" <sdfg@asd.g>
Subject: Re: HTTP_WEFERER ????
Message-Id: <y5dr6.79190$UZ4.19908233@news4.rdc1.on.home.com>

"Richard" <rworth5@home.com> wrote in message
news:87cr6.3631$rB2.297441@news1.rdc1.mb.home.com...
> print  "<TT>\n";
> foreach $key (sort keys(%ENV)) {
>  print "$key = $ENV{$key}<p>";
> }
>
> And where the HTTP_REFERER is suppose to be I get HTTP_WEFERER.

Then your question has nothing to do with Perl, any CGI would get the same
results. Your web server seems to have suffered slight brain damage (at
least, that's my best guess). Find a group that relates to whatever
webserver you're using and ask for help there.


LKembel




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

Date: Tue, 13 Mar 2001 11:10:43 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Pass in variables to web page
Message-Id: <98jhhf$oq8$1@hermes.nz.eds.com>


"Abigail" <abigail@foad.org> wrote in message
news:slrn9ap8if.db9.abigail@tsathoggua.rlyeh.net...
>
> And your Perl question is?
>
>
> HTLM issues are discussed elsewhere.

Hypertext Lovers Manual?




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

Date: Mon, 12 Mar 2001 15:41:52 -0800
From: "Jack Thomas" <thomasj@europa.com>
Subject: Re: Perl And CGI
Message-Id: <3aad5fc4$1_1@news.nwlink.com>

www.activestate.com
for perl which runs on a number of platforms.





In the mean time check out.....

www.linux.org
www.redhat.com
www.caldera.com
www.debian.org
http://www.linux-mandrake.com/
and on and on and on.....

www.openbsd.org
For another great OS.
(SECURE but a pain to install for newbies.)

www.apache.org
For "THE" standard in web servers

- Jack

wrote in message news:3aaccd6f@news.bezeqint.net...
> Hello Friends
>
> Can any one help me how can i run perl And work with CGI on
> Windows 2000 (NT5) ?
>
> Or Should i need a file and where can i get it ?




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

Date: Tue, 13 Mar 2001 09:51:40 +0800
From: Hugo Bouckaert <hugo@fractalgraphics.com.au>
Subject: preserve unix path when obtaining parameters from upload field
Message-Id: <3AAD7D2C.1AD41710@fractalgraphics.com.au>

Hi 

Thanks very much to all who responded to my previous question regarding
translating a windows path with backslashes to forward slashes. That was
a fantastic reponse and really helped me out.

I have another minor question that nevertheless also seems rather
intractable. When I upload a file under unix, I obtain a path with
forward slashes of course. But when I try to obtain the parameter of
that field, I do not get the full path, but only the filename at the
end. For example, if, in my perl script, I create an upload field like
this: 

print "<tr><td><INPUT TYPE=\"FILE\" NAME=\"document\"
SIZE=\"60\"><br><br>"; 

and I try to get the parameter: 

$filepath = $query->param('document');

I only get the filename at the end, not the full path. 

So if in the above field, I upload:

/directory1/directory2/directory3/somefile.doc

$filepath will only contain "somefile.doc", not the full string
"/directory1/directory2/directory3/somefile.doc"

However, I need to have the full path as I need to know the path to the
filename as well as the  filename itself.

Does anyone knows why this happens? Any help will be greatly
appreciated. 

Thanks

Hugo  

-- 
Dr Hugo Bouckaert
R&D Support Engineer, Fractal Graphics 
39 Fairway, Nedlands Western Australia 6009
Tel: +618 9386 7917
Email:hugo@fractalgraphics.com.au
Web: http://www.fractalgraphics.com.au


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

Date: Mon, 12 Mar 2001 19:32:04 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Reading and writing files
Message-Id: <Pine.A41.4.21.0103121926130.20134-100000@ginger.libs.uga.edu>

On Mon, 12 Mar 2001, Milliwave wrote:
> I have two separate files. "file1" having two columns of information while
> "file 2" has another
> 4 columns of information. How can I combine all columns into a third file,
> without disrupting
> the tabular form?
> 
> col1   col 2  col3   col4   col 5   col6
> 1        45       4        44      33       33
> 2        56       5        40      32       11
> 3        45       4        34      23       23
> 4        23       3        43      11       66

Have you tried anything yet?  I can think of a few very simple answers,
which makes me wonder if I really understand your problem.

By the way, the tabular form you show above looks pretty disrupted.  Is
that what you really want?

Brad



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

Date: Tue, 13 Mar 2001 01:06:55 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Reading and writing files
Message-Id: <3aad6d0e.14949938@news.erols.com>

On Mon, 12 Mar 2001 20:19:07 -0000, "Milliwave"
<milliwave@rfengineering.freeserve.co.uk> wrote:

>I have two separate files. "file1" having two columns of information while
>"file 2" has another
>4 columns of information. How can I combine all columns into a third file,
>without disrupting
>the tabular form?

Of the three articles you posted within two hours, this one states the
root problem most clearly.

>col1   col 2  col3   col4   col 5   col6
>1        45       4        44      33       33

Yikes.  If those columns appear to you to line up, you're using a
proportional font.  You should use a fixed-width font when composing
articles to be posted to this newsgroup.

  while (<INPUT_FILE1>) {
    chomp $_;
    #If you want to do some other processing with the line
    #from the first file, do it here.
    print OUTPUT_FILE $_ . "\t" . <INPUT_FILE2>;
  }

Change "\t" to suit your taste if you want something other than a tab
between columns 2 and 3.


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

Date: Tue, 13 Mar 2001 01:49:41 GMT
From: zawy@yahoo.com (zawy)
Subject: reg exp question
Message-Id: <3aad7c16.48202760@news.knology.net>

I thought I knew REs.

$a=12
$b=12

The following return TRUE
$a=~/^$b/
$a=~/^$b$/
$a=~/$b$/

The following returns FALSE
$a=~/$b/

Why FALSE?



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

Date: Tue, 13 Mar 2001 02:00:13 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: reg exp question
Message-Id: <3AAD7F3B.78A976D0@Home.Com>

zawy wrote:
> 
> I thought I knew REs.
> 
> $a=12
> $b=12
> 
> The following return TRUE
> $a=~/^$b/
> $a=~/^$b$/
> $a=~/$b$/
> 
> The following returns FALSE
> $a=~/$b/
> 
> Why FALSE?

No it doesn't. What you say isn't true. That's why you should
_always_ cut and paste real examples.


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

Date: Tue, 13 Mar 2001 11:44:28 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: reg exp question
Message-Id: <bcfr6.9$zZ2.3998@vic.nntp.telstra.net>

"zawy" <zawy@yahoo.com> wrote in message
news:3aad7c16.48202760@news.knology.net...
> I thought I knew REs.
>
> $a=12
> $b=12
>
> The following return TRUE
> $a=~/^$b/
> $a=~/^$b$/
> $a=~/$b$/
>
> The following returns FALSE
> $a=~/$b/

But it doesn't, so you are doing something else wrong...

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";





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

Date: Tue, 13 Mar 2001 03:02:47 +0100
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: reg exp question
Message-Id: <130320010302472176%wuerz@yahoo.com>

In article <3aad7c16.48202760@news.knology.net>, zawy@yahoo.com (zawy)
wrote:

> The following returns FALSE
> $a=~/$b/

How did you test?

my $a=12;
my $b=12;

print $a=~/$b/ ? 'true' : 'false';

prints true for me.

(I do recall dimly that there was a reason not to use $a and $b, but
specifics escape me at the moment. Don't know if that has to do with
your dilemma.)

-mona


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

Date: Tue, 13 Mar 2001 02:04:47 GMT
From: "Brian Racer" <brian@brianracer.com>
Subject: SSI Help...
Message-Id: <3ffr6.222$dC6.10349@typhoon.mw.mediaone.net>


Hello. I am having problems implementing my perl script with SSI. First of
all I know the script works. I first tried using the Xitami server. My
scripts would execute untill it tried to access a file, then I started
having problems. I then decided to try IIS v.4. Now nothing displayes. I
believe I have everything setup correctly because I have gotten some SSI
things to work but anytime I try <!--#exec cgi="/cgi-bin/weekinfo.pl" -->
nothing shows up(well, the page does, just not any info the script should
generate). I would appreciate ANY suggestions. Once again I am runngin IIS
v.4 and Windows 2000. The scripts IS in an .shtml format(well the webpage
where the SSI insruction is). I am running the newest stable version of
Active Perl, and it is setup correctly in IIS. Thanks again!

Brian Racer
brian@brianracer.com





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

Date: Mon, 12 Mar 2001 23:34:52 GMT
From: "S51" <sdfg@asd.g>
Subject: Re: SSI in CGI?
Message-Id: <w2dr6.79186$UZ4.19903059@news4.rdc1.on.home.com>

"PaAnWa" <paanwa@hotmail.com> wrote in message
news:taq68f4jdc2d76@corp.supernews.com...
> Is it possible to display the contents of a text file at the end of a CGI?
> I would like to display an HTML file at the end of a perl script....what
is
> the syntax?  I tried to use a regular SSI but that only works in HTML.

Don't think in terms of SSI, Perl is more powerful than HTML.

open(FILE, "<myfile") || die $!;
while (<FILE>)
{
    print $_;
}
close(FILE) || die $!;


LKembel




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

Date: 12 Mar 2001 23:24:31 GMT
From: pehrens@nospam.ligo.caltech.edu (Phil Ehrens)
Subject: Re: Tk based alarm clock
Message-Id: <98jlrf$l56@gap.cco.caltech.edu>

He means same system --

Let's see... mmm... ps -Ao fname,vsz |grep tclsh... pmap 6514...
mumble mumble... count on fingers...

Looks like between 250 and 300 Kb for each new interp on both
Linux and Solaris.  The rest is .so's.

Phil

* Tong * wrote:
>"Donal K. Fellows" <fellowsd@cs.man.ac.uk> writes:
>
>> Victor Wagner wrote:
>> > By the way, it would require perl or Tcl interpreter to stay in memory
>> > during all your login session, and this seems to much for just an alarm
>> > clock.
>> 
>> It depends on whether you already have an interpreter already present.
>> The overhead for a separate interpreter within an already-running
>> process is pretty small...
>
>Thanks, Donal. You've answered a question that I wanted to ask. :-)
>Can you just explain a little bit on the term "already-running
>process" please? 
>
>Does it means within same shell, or same user or same X system...?


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

Date: Tue, 13 Mar 2001 11:54:51 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Typeglob assignment confusion
Message-Id: <98jk46$tkl$1@hermes.nz.eds.com>


"James Taylor" <james@NOSPAM.demon.co.uk> wrote in message
news:ant121401d07fNdQ@oakseed.demon.co.uk...
> Great stuff. What a pity that both the RISC OS port I'm using and my
> ISP's installed copy of perl are still at version 5.005_03. Also, even
> if I were able to overcome those two installations and started using
> Perl 6 features such as 'our', what guarantee would I have that I
> would always be able to run my scripts on another server? In other
> words, I think I'll have to do without 'our' until such time as Perl 6
> installations become more common.

s/Perl 6/Perl 5.6/




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

Date: Tue, 13 Mar 2001 00:29:55 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Typeglob assignment confusion
Message-Id: <ant130055313fNdQ@oakseed.demon.co.uk>

In article <98jk46$tkl$1@hermes.nz.eds.com>, Peter Sundstrom
<URL:mailto:peter.sundstrom-eds@eds.com> wrote:
> 
> "James Taylor" <james@NOSPAM.demon.co.uk> wrote in message
> news:ant121401d07fNdQ@oakseed.demon.co.uk...
> >
> > Perl 6 features such as 'our',
> 
> s/Perl 6/Perl 5.6/

I stand corrected, thanks.

-- 
James Taylor <james (at) oakseed demon co uk>
Based in Hammersmith, London, UK.
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: 13 Mar 2001 01:04:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Why glob doesn't take a list?
Message-Id: <98jrmu$dqq$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>],
who wrote in article <98iogl$3e4$3@mamenchi.zrz.TU-Berlin.DE>:
> > As an aside: I have always wondered the same thing WRT undef().

> Maybe it wasn't considered necessary?  There's
> 
>     ( $x, $y, @a) = ();
> 
> to undef multiple things.

This is a multi-assignment of undef, not multi-undef'ing.

undef $x has an additional side-effect of freeing the buffers,
comparing to $x = undef.

Ilya


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

Date: Tue, 13 Mar 2001 01:45:09 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why glob doesn't take a list?
Message-Id: <sruqatsddd0pp8dnbvel8a266oq03s4ens@4ax.com>

Ilya Zakharevich wrote:

>> > As an aside: I have always wondered the same thing WRT undef().
>
>> Maybe it wasn't considered necessary?  There's
>> 
>>     ( $x, $y, @a) = ();
>> 
>> to undef multiple things.
>
>This is a multi-assignment of undef, not multi-undef'ing.
>
>undef $x has an additional side-effect of freeing the buffers,
>comparing to $x = undef.

So, why doesn't undef work an a variable list? The only reason I can
think of, is that undef returns a scalar, and it wouldn't be clear what
it ought to return in case of a list of parameters. But that can be
simple enough: it should always return undef.

-- 
	Bart.


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

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 V10 Issue 474
**************************************


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