[30894] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2139 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 19 09:09:46 2009

Date: Mon, 19 Jan 2009 06:09:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 19 Jan 2009     Volume: 11 Number: 2139

Today's topics:
        Concatenating regular exprs in a 'grep' call <freesoft12@gmail.com>
    Re: Concatenating regular exprs in a 'grep' call <thepoet_nospam@arcor.de>
    Re: Concatenating regular exprs in a 'grep' call <rvtol+usenet@xs4all.nl>
    Re: Concatenating regular exprs in a 'grep' call <tadmc@seesig.invalid>
    Re: fastest way to allocate memory ? <nospam-abuse@ilyaz.org>
    Re: fastest way to allocate memory ? <nospam-abuse@ilyaz.org>
    Re: fastest way to allocate memory ? <stoupa@practisoft.cz>
    Re: IPC::Shareable::SharedMem: shmget: Permission denie <nitte.sudhir@gmail.com>
        new CPAN modules on Mon Jan 19 2009 (Randal Schwartz)
    Re: unable to open file <Tintin@teranews.com>
    Re: unable to open file <bill@ts1000.us>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 18 Jan 2009 20:49:14 -0800 (PST)
From: "freesoft12@gmail.com" <freesoft12@gmail.com>
Subject: Concatenating regular exprs in a 'grep' call
Message-Id: <13e2f75c-2139-490d-820e-a8f628bb346f@v18g2000pro.googlegroups.com>

Hi,

I want to concatenate multiple regular expressions using '||' or '&&'
operations in a 'grep' call.
---------------------
For example:

my @orig_list = ('apple', 'orange', 'pineapple','banana','pear');

# I want to find  'apple' or 'banana' in the list
my @regex_str = "/apple/ || /banana/";

# negate the concatenated expresson so that
# the 'grep' call will return 'orange' , 'pear'
my @results = grep( ! $regex_str,@orig_list);

# print 'orange', 'pear'
foreach my $r (@results) {
  print $r." ";
}
print "\n";
-------------------------------------

This program currently doesn't match anything. I get an empty
'@results' list.

Any suggestions?

Regards
John


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

Date: Mon, 19 Jan 2009 06:44:36 +0100
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: Concatenating regular exprs in a 'grep' call
Message-Id: <497412fd$0$31337$9b4e6d93@newsspool4.arcor-online.net>

freesoft12@gmail.com schrieb:
> I want to concatenate multiple regular expressions using '||' or '&&'
> operations in a 'grep' call.
> ---------------------
> For example:
> 
> my @orig_list = ('apple', 'orange', 'pineapple','banana','pear');
> 
> # I want to find  'apple' or 'banana' in the list
> my @regex_str = "/apple/ || /banana/";
> 
> # negate the concatenated expresson so that
> # the 'grep' call will return 'orange' , 'pear'
> my @results = grep( ! $regex_str,@orig_list);
> 
> # print 'orange', 'pear'
> foreach my $r (@results) {
>   print $r." ";
> }
> print "\n";
> -------------------------------------
> 
> This program currently doesn't match anything. I get an empty
> '@results' list.

You are having us on. The script above outputs all the elements of
@orig_list. Please at least try out your examples before posting
them.

You should also really try running examples like the above with
"use strict;" and "use warnings;" to avoid putting in additional
trivial errors, like assigning to @regex_str, but using $regex_str
later on.

To you question: what you assign to [@$]regex_str is not a
regular expression, but a perl expression. If you want that
string to do anything, you will have to use something dangerous
like 'eval'.

For what you want, you will have to change your regex to a
single one that ORs all the words:
my @pats = qw(apple banana);
my $regex = join '|', @pats;
my @results = grep $_ !~ /$re/, @orig_list;

Or you work with a nested loop, first iterating over all the elements
in @orig_list and then checking each pattern before deciding if the
element is to be appended to @results. That would be more flexible,
but also a little bit more code.

my @results;
my @patterns = (apple banana);
foreach my $elm ( @orig_list ) {
	my $good = 1;
	foreach my $pat ( @patterns ) {
		$good = 0 if( $elm =~ /$pat/ );
	}
	push @results, $elm if( $good );
}

-Chris


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

Date: Mon, 19 Jan 2009 07:08:06 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Concatenating regular exprs in a 'grep' call
Message-Id: <497418c7$0$193$e4fe514c@news.xs4all.nl>

freesoft12@gmail.com wrote:

> my @orig_list = ('apple', 'orange', 'pineapple','banana','pear');

   my @all = qw/ apple orange pineapple banana pear /;


> # I want to find  'apple' or 'banana' in the list
> my @regex_str = "/apple/ || /banana/";

You make an array where you need a scalar. Further you put a code 
construct in a string (so not a Perl regex).


   my @ignore = qw/ apple banana /;

   my $re = join "|", @ignore;
   $re = qr/\b$re\b/;  # optional: add word boundaries, compile


> # negate the concatenated expresson so that
> # the 'grep' call will return 'orange' , 'pear'
> my @results = grep( ! $regex_str,@orig_list);

   my @results = grep !/$re/, @all;


> # print 'orange', 'pear'
> foreach my $r (@results) {
>   print $r." ";
> }
> print "\n";

   print "@results\n";


So the script becomes:

#!/usr/bin/perl
   use strict;
   use warnings;

   my @all = qw/ apple orange pineapple banana pear /;

   my @ignore = qw/ apple banana /;

   my $re = join "|", @ignore;
   $re = qr/\b(?:$re)\b/;  # optional

   my @results = grep !/$re/, @all;

   print "@results\n";

__END__


Because of the word boundaries, this will print pineapple too.


Alternative way to make $re:

   my $re = do {local $"='|'; qr/\b(?:@ignore)\b/};

-- 
Ruud


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

Date: Mon, 19 Jan 2009 07:03:48 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Concatenating regular exprs in a 'grep' call
Message-Id: <slrngn8uhk.i77.tadmc@tadmc30.sbcglobal.net>

freesoft12@gmail.com <freesoft12@gmail.com> wrote:


> Any suggestions?


Several:

    Always enable "use warnings;" when developing Perl code.
    
    Always enable "use strict;" when developing Perl code.
    
    Understand the difference between what is "code" and what is "data".
    
    Post a short and complete program that we can run.
    
    See the Posting Guidelines that are posted here frequently.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Mon, 19 Jan 2009 08:26:46 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: fastest way to allocate memory ?
Message-Id: <gl1dg6$1eti$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Petr Vileta \"fidokomik\"
<stoupa@practisoft.cz>], who wrote in article <gkvcgq$30kg$1@ns.felk.cvut.cz>:
> "Ilya Zakharevich" <nospam-abuse@ilyaz.org> pe v diskusnm pspvku 
> news:gkupi0$m2m$1@agate.berkeley.edu...
> 
> > $gras x= 1024 * 1024 * 10000;
> 
> From which Perl version this x= operator work (5.8 or 5.10)?

The first I saw was v4.010.  I do not remember the timeline of Perl,
but I would expect it would be there from v2.early or somesuch...

Yours,
Ilya


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

Date: Mon, 19 Jan 2009 08:30:53 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: fastest way to allocate memory ?
Message-Id: <gl1dnt$1eu9$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Xho Jingleheimerschmidt 
<xhoster@gmail.com>], who wrote in article <4973797e$0$25707$ed362ca5@nr5c.newsreader.com>:
> >> $gras = $gras.$needle;
> > 
> > RHS takes another 10000GiB.
> 
> It seems that, at least as of 5.8.8, this construct is optimized
> to be about the same as $gras.=$needle, and as long as there is room to 
> grow $gras in-place it does not need to be copied.

Interesting...  What about

  $gras = $pre.$gras;
  $gras = $pre.$gras.$needle;

when there is enough place on the left (and right)?  This would be
much more useful (since one can always use explicit .= for the initial
construct)...

Yours,
Ilya


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

Date: Mon, 19 Jan 2009 01:29:19 +0100
From: "Petr Vileta \"fidokomik\"" <stoupa@practisoft.cz>
Subject: Re: fastest way to allocate memory ?
Message-Id: <gl1ou0$2lol$1@ns.felk.cvut.cz>

Peter J. Holzer wrote:
> On 2009-01-18 13:53, Petr Vileta "fidokomik" <stoupa@practisoft.cz>
> wrote:
>> "Ilya Zakharevich" <nospam-abuse@ilyaz.org> píše v diskusním
>> příspěvku news:gkupi0$m2m$1@agate.berkeley.edu...
>>
>>> $gras x= 1024 * 1024 * 10000;
>>
>> From which Perl version this x= operator work (5.8 or 5.10)?
>
> At least 5.005_03:
>
You are true, curious :-) I don't know why I never found it.
-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>



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

Date: Sun, 18 Jan 2009 22:46:17 -0800 (PST)
From: kath <nitte.sudhir@gmail.com>
Subject: Re: IPC::Shareable::SharedMem: shmget: Permission denied
Message-Id: <142b80e7-1886-43ba-84b0-0b845126c8bf@w1g2000prk.googlegroups.com>

On Jan 16, 1:56 pm, Daniel Molina Wegener
<dmwREMOVEUPPERC...@coder.cl> wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> kath <nitte.sud...@gmail.com>
> on Friday 16 January 2009 03:59
> wrote in comp.lang.perl.misc:
>
>
>
> > Hi,
> > I have a simple script to test variable sharing between two perl
> > processes,
> > use IPC::Shareable;
> > $robj = {status=>'init'};
> > tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 1, mode
> > => 664, destroy => 1};
> > $pid = fork();
> > unless(defined $pid){
> > print "Error durigng fork\n";
> > }
> > if($pid){
> > $robj->{parent=>'parent'};
> > }else{
> > tie $robj->{status}, 'IPC::Shareable', 'data_glue', {create => 0, mode
> > => 664, destroy => 0};
> > $robj->{status} = 'updated';
> > sleep(5);
> > exit(0);
> > }
> > print "\n", $robj->{status}, "\n";
>
> > When i run i get following error.
> > IPC::Shareable::SharedMem: shmget: Permission denied
> >  at /usr/lib/perl5/site_perl/5.8.3/IPC/Shareable.pm line 566
> > Could not create shared memory segment:
> >  at test_ipc_shareable.pl line 3
>
>   Well, you are making the user to create the block under 0664
> permissions, are the both users in the same group? In other case,
> if both users are on different group they can't handle the shared
> memory block.
>
>   If you are under Linux, remember that when you create a new user,
> the user holds a new individual group, and is not invited to new
> groups until you invite him.
>
>   Try setting both users in the same group by inviting them...
>
>
>
> > Problem: I get above error when run as user account other than
> > 'root' . But the script used to work before, but started throwing this
> > error, after server where this script runs was down due to storage
> > corruption. I am getting this error after server came online.
> > I am using perl v5.8.3 and IPC::Shareable v0.60. I tried reinstalling
> > the package, using cpan shell, force make IPC::Shareable', but the
> > unfortunately 'test IPC::Shareable' fails.
>
> > Does any one know how to resolve this? Because running as 'root'
> > creates other problems for my main scripts.
>
> > Thanks in advance,
> > katharnakh.
>
> Best regards,
> - --
>  .O. | Daniel Molina Wegener   | FreeBSD & Linux
>  ..O | dmw [at] coder [dot] cl | Open Standards
>  OOO |http://coder.cl/       | FOSS Developer
> -----BEGIN xxx SIGNATURE-----
> Version: GnuPG v1.4.8 (FreeBSD)
>
> iEYEARECAAYFAklwS8EACgkQxyPEFPXO3WEmzQCdGyopJC+y9Tk8sUZW2B8rSq3A
> 74IAnA3/AThKFEeAntYehpFK8QDCb4rG
> =VtpM
> -----END PGP SIGNATURE-----

Thanks, the problem got resolved.

katharnakh.


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

Date: Mon, 19 Jan 2009 05:42:25 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Jan 19 2009
Message-Id: <KDpEIp.77L@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

AI-Genetic-Pro-0.33
http://search.cpan.org/~strzelec/AI-Genetic-Pro-0.33/
Efficient genetic algorithms for professional purpose. 
----
Acme-Curses-Marquee-Extensions-0.04
http://search.cpan.org/~jpierce/Acme-Curses-Marquee-Extensions-0.04/
Extensions for Acme::Curses::Marquee 
----
Apache2-EmbedFLV-0.1.1
http://search.cpan.org/~damog/Apache2-EmbedFLV-0.1.1/
Embed FLV videos into a templated web interface using Flowplayer. 
----
Apache2-EmbedFLV-0.2
http://search.cpan.org/~damog/Apache2-EmbedFLV-0.2/
Embed FLV videos into a templated web interface using Flowplayer. 
----
B-Generate-1.20
http://search.cpan.org/~rurban/B-Generate-1.20/
Create your own op trees. 
----
B-Hooks-EndOfScope-0.06
http://search.cpan.org/~flora/B-Hooks-EndOfScope-0.06/
Execute code after a scope finished compilation 
----
Binding-0.03
http://search.cpan.org/~gugod/Binding-0.03/
eval with variable binding of caller stacks. 
----
CGI-Application-Plugin-YAML-0.02
http://search.cpan.org/~cosmicnet/CGI-Application-Plugin-YAML-0.02/
YAML methods CGI::App 
----
CPAN-Testers-WWW-Reports-Mailer-0.11
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Reports-Mailer-0.11/
CPAN Testers Reports Mailer 
----
Catalyst-Plugin-BuildURI-0.1
http://search.cpan.org/~zigorou/Catalyst-Plugin-BuildURI-0.1/
Build URI by action name, namespace, and args 
----
Catalyst-Plugin-I18N-Request-0.05
http://search.cpan.org/~bricas/Catalyst-Plugin-I18N-Request-0.05/
A plugin for localizing/delocalizing paths and parameters. 
----
Class-Method-Modifiers-Fast-0.03
http://search.cpan.org/~kitano/Class-Method-Modifiers-Fast-0.03/
provides Moose-like method modifiers 
----
Cluster-Similarity-v0.02
http://search.cpan.org/~ingrif/Cluster-Similarity-v0.02/
compute the similarity of two classifications. 
----
Dansguardian-0.5
http://search.cpan.org/~mogaal/Dansguardian-0.5/
Simple module for administer dansguardian's control files. 
----
Devel-PPPort-3.15
http://search.cpan.org/~mhx/Devel-PPPort-3.15/
Perl/Pollution/Portability 
----
Dotiac-addon-unparsed-0.1
http://search.cpan.org/~maluku/Dotiac-addon-unparsed-0.1/
----
Fey-ORM-0.19
http://search.cpan.org/~drolsky/Fey-ORM-0.19/
A Fey-based ORM 
----
Fey-ORM-Mock-0.02
http://search.cpan.org/~drolsky/Fey-ORM-Mock-0.02/
Mock Fey::ORM based classes so you can test without a DBMS 
----
GPS-Point-Filter-0.02
http://search.cpan.org/~mrdvt/GPS-Point-Filter-0.02/
Algorithm to filter extraneous GPS points 
----
GStreamer-0.14
http://search.cpan.org/~tsch/GStreamer-0.14/
Perl interface to the GStreamer library 
----
Module-CoreList-2.17
http://search.cpan.org/~rgarcia/Module-CoreList-2.17/
what modules shipped with versions of perl 
----
MooseX-Role-Parameterized-0.03
http://search.cpan.org/~sartak/MooseX-Role-Parameterized-0.03/
parameterized roles 
----
Net-FSP-0.15
http://search.cpan.org/~leont/Net-FSP-0.15/
A client implementation of the File Service Protocol 
----
Net-GPSD-0.37
http://search.cpan.org/~mrdvt/Net-GPSD-0.37/
Provides an object client interface to the gpsd server daemon. 
----
Object-Store-0.01
http://search.cpan.org/~jhiver/Object-Store-0.01/
abstract class to store, modify, delete and search Perl objects 
----
POE-Component-Server-Twirc-0.06
http://search.cpan.org/~mmims/POE-Component-Server-Twirc-0.06/
Twitter/IRC gateway 
----
POE-Component-SmokeBox-Recent-1.02
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Recent-1.02/
A POE component to retrieve recent CPAN uploads. 
----
Parse-Marpa-1.001_005
http://search.cpan.org/~jkegl/Parse-Marpa-1.001_005/
Generate Parsers from any BNF grammar 
----
Perl-Critic-1.095_001
http://search.cpan.org/~elliotjs/Perl-Critic-1.095_001/
Critique Perl source code for best-practices. 
----
Perl-Critic-Pulp-14
http://search.cpan.org/~kryde/Perl-Critic-Pulp-14/
some add-on perlcritic policies 
----
Pod-ToDocBook-0.2
http://search.cpan.org/~zag/Pod-ToDocBook-0.2/
Pluggable converter POD data to DocBook. 
----
Roguelike-Utils-0.4.132
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.132/
----
Roguelike-Utils-0.4.136
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.136/
----
Roguelike-Utils-0.4.149
http://search.cpan.org/~earonesty/Roguelike-Utils-0.4.149/
----
SQL-Statement-1.17
http://search.cpan.org/~rehsack/SQL-Statement-1.17/
SQL parsing and processing engine 
----
SQL-Statement-1.18_01
http://search.cpan.org/~rehsack/SQL-Statement-1.18_01/
SQL parsing and processing engine 
----
Shipwright-2.0.0
http://search.cpan.org/~sunnavy/Shipwright-2.0.0/
Best Practical Builder 
----
Simo-0.0401
http://search.cpan.org/~kimoto/Simo-0.0401/
Very simple framework for Object Oriented Perl. 
----
Sys-Sendfile-0.02
http://search.cpan.org/~leont/Sys-Sendfile-0.02/
Zero-copy data transfer 
----
Sys-Statistics-Linux-0.44_02
http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.44_02/
Front-end module to collect system statistics 
----
Template-Multilingual-1.00
http://search.cpan.org/~cholet/Template-Multilingual-1.00/
Multilingual templates for Template Toolkit 
----
Template-Provider-Markdown-0.04
http://search.cpan.org/~gugod/Template-Provider-Markdown-0.04/
Markdown as template body, no HTML. 
----
Test-SFTP-0.02
http://search.cpan.org/~xsawyerx/Test-SFTP-0.02/
----
Test-Without-Module-0.17
http://search.cpan.org/~corion/Test-Without-Module-0.17/
Test fallback behaviour in absence of modules 
----
Variable-Magic-0.27
http://search.cpan.org/~vpit/Variable-Magic-0.27/
Associate user-defined magic to variables from Perl. 
----
WWW-DoctypeGrabber-0.004
http://search.cpan.org/~zoffix/WWW-DoctypeGrabber-0.004/
grab doctypes from webpages 
----
WWW-Page-1.99
http://search.cpan.org/~andy/WWW-Page-1.99/
XSLT-based and XML-configured website engine 
----
WWW-Page-2.0
http://search.cpan.org/~andy/WWW-Page-2.0/
XSLT-based and XML-configured website engine 
----
WWW-Page-2.02
http://search.cpan.org/~andy/WWW-Page-2.02/
XSLT-based and XML-configured website engine 
----
WWW-Search-Ebay-3.005
http://search.cpan.org/~mthurn/WWW-Search-Ebay-3.005/
backend for searching www.ebay.com 
----
WWW-Search-Ebay-3.006
http://search.cpan.org/~mthurn/WWW-Search-Ebay-3.006/
backend for searching www.ebay.com 
----
WWW-TinySong-0.04_01
http://search.cpan.org/~miorel/WWW-TinySong-0.04_01/
Get free, shortened music links from tinysong.com 
----
WWW-TinySong-0.04_02
http://search.cpan.org/~miorel/WWW-TinySong-0.04_02/
Get free music links from tinysong.com 
----
WWW-Tube8-1.0.0
http://search.cpan.org/~bayashi/WWW-Tube8-1.0.0/
Get video informations from tube8.com 
----
XML-DT-0.53
http://search.cpan.org/~ambs/XML-DT-0.53/
a package for down translation of XML files 
----
podlators-2.2.2
http://search.cpan.org/~rra/podlators-2.2.2/


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Mon, 19 Jan 2009 20:58:37 +1300
From: "Tintin@teranews.com" <Tintin@teranews.com>
Subject: Re: unable to open file
Message-Id: <VoWcl.22777$1k1.4923@newsfe14.iad>

Peter J. Holzer wrote:
> On 2009-01-18 19:44, Tintin@teranews.com <Tintin@teranews.com> wrote:
>> I don't want to flog a dead horse (or camel) here, but I'll give you an 
>> example of where knowing the script location rather than CWD is useful.
>>
>> Say you have the dir structure
>>
>> /var/www/cgi-bin
>> /var/www/config
>>
>> and in your Perl/CGI script, you have
>>
>> require '../config/file.cfg';
>>
>> Now this path is reliant on the location of the script in the cgi-bin 
>> directory, which may or may not be CWD.
> 
> No.

OK, so say my CWD is /var/www and the script will fail when you do the 
require.

Hence if you know where the location of the CGI script is, you can 
correctly work out where the configuration file is.

This horse sure is taking a beating.


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

Date: Mon, 19 Jan 2009 03:31:46 -0800 (PST)
From: Bill H <bill@ts1000.us>
Subject: Re: unable to open file
Message-Id: <5f2c9da3-c1a4-4042-a566-bd46b79c53d8@m16g2000vbp.googlegroups.com>

On Jan 14, 5:23=A0pm, Ken Teague <"kteague at pobox dot com"> wrote:
> Tim Greer wrote:
> >> Thank you all for your assistance. =A0I've circumvented the problem by
> >> adding the following to line 11 of the perl script:
>
> >> =A0 chdir('E:\\0\\0\\25\\44\\188533\\user\\191178\\htdocs\\') or die
> >> =A0 ("Cannot cd to new directory: $!\n");
>
> >> I'm not keen on this circumvention because of using an absolute file
> >> system path. =A0If this is the only way to resolve the issue, I guess
> >> I'll have to stick with it. =A0If there's a way to use relative pathin=
g,
> >> I'd like to know how. =A0Thanks!
>
> >> - Ken
>
> > Shouldn't you be able to use / on Windows, rather than escaping each \
> > with \\? =A0I thought you could? =A0I've not used Windows for a decade,=
 so
> > I don't recall, but I think you can use /? =A0
>
> VI looks at using / as the delimiter as syntactically correct. =A0I've
> implemented this change and it seems to work fine. =A0Thanks for that inf=
o.
>
> > Anyway, for using the relative path, it's difficult to say, we'd need
> > to know the path of the file/directory "relative" to the script.
> > What's the absolute path you're accessing this from and to? =A0Which
> > is the above; from, or to?
>
> Since this is a hosted server and I only have FTP access, I was able to
> determine it's running ActiveState perl v5.8.7. =A0In my experience (and
> if memory serves me right), this is installed under:
> =A0 C:\Program Files\ActiveState\perl\bin
> Since this box is hosted and I only have FTP access, I don't have the
> ability to set environment variables. =A0It's also a Windows box, so I
> don't think I can execute shell commands with backticks.
>
> The web root is:
> =A0 E:\0\0\25\44\188533\user\191178\htdocs
> ... and there's a cgi-bin directory underneath it:
> =A0 E:\0\0\25\44\188533\user\191178\htdocs\cgi-bin
>
> The perl script resides in:
> =A0 E:\0\0\25\44\188533\user\191178\htdocs\cgi-bin
>
> E:\0\0\25\44\188533\user\191178\htdocs\cgi-bin contains the following:
> =A0 csvsearch.pl
> =A0 prodscript.html
> =A0 products.txt
>
> csvsearch.pl is, of course, the perl script we're dealing with.
> prodscript.html is the web page that csvsearch.pl gives its data to and
> is the "search results" page. =A0products.txt is a simple text file
> containing product IDs and description in this format:
> =A0 productID|description|productID.pdf
> ... for example:
> =A0 227229|PRETREATMENT CARPET 28H 34858 3M TWIST'N 62L|227229.pdf
> =A0 350111|POLISH SS AERO 14002 3M 1221oz|350111.pdf
>
> - Ken- Hide quoted text -
>
> - Show quoted text -

Ken

Are you sure the cgi-bin is where you see it in ftp? I took over a
windows hosted website last year (on network solutions) with a cgi-bin
in the htdocs, and was stumped for days as to why my changes to perl
scripts and new scripts uploaded didnt take effect. After exploring I
learned that the cgi-bin was actually in the same folder as htdocs and
that the cgi-bin I was accessing was a folder created by the previous
webmaster by mistake. So in the browser I would have accessed the
scripts with http://www.example.com/cgi-bin/test.pl in actuallity it
was accessing ../../cgi-bin/test.pl.

Bill H


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 2139
***************************************


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