[30645] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1890 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 30 11:09:53 2008

Date: Tue, 30 Sep 2008 08:09:15 -0700 (PDT)
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, 30 Sep 2008     Volume: 11 Number: 1890

Today's topics:
        Advice on module for plotting graphs (Vicky Conlan)
        extracting strings from a text file <yandry77@gmail.com>
    Re: extracting strings from a text file <josef.moellers@fujitsu-siemens.com>
    Re: File edits in a Perlish way <bernie@fantasyfarm.com>
    Re: File edits in a Perlish way <rkb@i.frys.com>
    Re: File edits in a Perlish way <pgodfrin@gmail.com>
    Re: File edits in a Perlish way <tadmc@seesig.invalid>
    Re: Help: Match Error <ben@morrow.me.uk>
    Re: Help: Match Error <tadmc@seesig.invalid>
    Re: Help: Process many files at the same time <tadmc@seesig.invalid>
        how to replace $1, $2, $3 ... <lehmannmapson@cnm.de>
    Re: how to replace $1, $2, $3 ... <mritty@gmail.com>
    Re: how to replace $1, $2, $3 ... <lehmannmapson@cnm.de>
    Re: how to replace $1, $2, $3 ... <tadmc@seesig.invalid>
    Re: how to replace $1, $2, $3 ... <josef.moellers@fujitsu-siemens.com>
    Re: how to replace $1, $2, $3 ... (Vicky Conlan)
    Re: how to replace $1, $2, $3 ... <tadmc@seesig.invalid>
    Re: how to replace $1, $2, $3 ... <RedGrittyBrick@spamweary.invalid>
    Re: how to replace $1, $2, $3 ... <peter@makholm.net>
    Re: How to unable the use of tainted mode in a CGI scri <bernie@fantasyfarm.com>
        Sybase::CTLib ct_connect problem somyasharma@gmail.com
    Re: use Class::Std :ATTR <Peter@PSDT.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 30 Sep 2008 14:38:43 +0000 (UTC)
From: comps@riffraff.plig.net (Vicky Conlan)
Subject: Advice on module for plotting graphs
Message-Id: <gbtdlj$15mj$1@magenta.plig.net>

I'm currently writing a small system to automate a process of
"cut+paste into excel, output as a graph" someone is currently
having to do.  Importing and munging the data I'm happy* with,
creating a graph I have absolutely no experience of.  

I've had a look around CPAN, but there appear to be a million
and one modules that may do what I'm looking for, does anyone
have any experience (good or bad) or advice on which direction
to go?

(One option is always to output excel-importable data and then
carry on using excel to create the graphs, but that's not really
very nice)

Given I don't think gnuplot is available, I'm currently looking
at SVG::Graph, but if there was something available that came
bundled with the standard distribution, that would probably win
the convenience vote.

Any hints and advice appreciated.

-- 


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

Date: Tue, 30 Sep 2008 05:52:59 -0700 (PDT)
From: Andry <yandry77@gmail.com>
Subject: extracting strings from a text file
Message-Id: <51a02b3b-e99f-41c6-ae3b-91568061e26d@2g2000hsn.googlegroups.com>

Hi,
I have a text file captured from an SSH session.
Each line of the text looks like this (opened with VI editor):
***********************************************************************************
-rw-r--r-- 1 root root 2389787 Sep 30 10:45 ^[[00mfilename.pl^[[00m
**********************************************************************************
As you can see a lot of spurious/control/special characters are shown
(in VI editor).
I need to extract just the filenames at the end of each line (getting
rid of spurious characters).
The result should be like this:
***********************************************************************************
filename.pl
***********************************************************************************
Of course, I don't know in advance the value of the string to extract
(nor its length to pass to a "substring" function).
Can you suggest any method to extract the single file name at the end
of each line?

Thank you,
Andrea


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

Date: Tue, 30 Sep 2008 15:43:19 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: extracting strings from a text file
Message-Id: <gbtadl$t6b$1@nntp.fujitsu-siemens.com>

Andry wrote:
> Hi,
> I have a text file captured from an SSH session.
> Each line of the text looks like this (opened with VI editor):
> ***********************************************************************************
> -rw-r--r-- 1 root root 2389787 Sep 30 10:45 ^[[00mfilename.pl^[[00m
> **********************************************************************************
> As you can see a lot of spurious/control/special characters are shown
> (in VI editor).
> I need to extract just the filenames at the end of each line (getting
> rid of spurious characters).
> The result should be like this:
> ***********************************************************************************
> filename.pl
> ***********************************************************************************
> Of course, I don't know in advance the value of the string to extract
> (nor its length to pass to a "substring" function).
> Can you suggest any method to extract the single file name at the end
> of each line?

The control characters are ANSI console control sequences.
AFAIK they consist of an ESC character followed by an optional left 
angle bracket followed by numbers separated by semicolons followed by a 
letter, so you might try to weed out "\033.*?[[:alpha:]]".

Another possibility would be to use the command "/bin/ls" rather than 
"ls", the latter is an alias for "ls --color=auto".

HTH,

Josef
-- 
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html


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

Date: Tue, 30 Sep 2008 08:18:25 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: File edits in a Perlish way
Message-Id: <n564e49ude6j6vom2m17jckc0r1cpakbbr@library.airnews.net>

Jürgen Exner <jurgenex@hotmail.com> wrote:

} pgodfrin <pgodfrin@gmail.com> wrote:
} >I have a need to pass a series of "edits" I'd like to apply in a
} >somewhat controlled manner.
} 
} Are those edits limited to one line at a time(a) or can a single edit
} spread across multiple lines(b) ?

} >and I intend to slurp the whole file into an array 
} 
} If (a) then ususally it is better to process the file line by line
} instead of slurping it in all at once.
} If (b) then manipulating the file in memory is probably easier.

Processing a file in-place [as he said he wants to do, since his
pseudo-code didn't include an output file] is pretty tricky to do line by
line, no?

  /bernie\

-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Tue, 30 Sep 2008 06:25:24 -0700 (PDT)
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: File edits in a Perlish way
Message-Id: <db25bd36-909f-476e-82cf-a7fec6961097@k7g2000hsd.googlegroups.com>

On Sep 30, 5:18=A0am, Bernie Cosell <ber...@fantasyfarm.com> wrote:
> J=FCrgen Exner <jurge...@hotmail.com> wrote:
> } pgodfrin <pgodf...@gmail.com> wrote:
> } >I have a need to pass a series of "edits" I'd like to apply in a
> } >somewhat controlled manner.
> }
> } Are those edits limited to one line at a time(a) or can a single edit
> } spread across multiple lines(b) ?
> } >and I intend to slurp the whole file into an array
> }
> } If (a) then ususally it is better to process the file line by line
> } instead of slurping it in all at once.
> } If (b) then manipulating the file in memory is probably easier.
>
> Processing a file in-place [as he said he wants to do,

He never specifically stated that he wanted to do an-inplace edit,
although it is a reasonable interpretation.

4. Write out file.

That could also be interpreted as writing out to a new file.

> since his
> pseudo-code didn't include an output file] is pretty tricky to do line by
> line, no?
>
No, it's not that tricky.
What part do you see as being tricky.

There are several approaches, 1 being the use of Tie::File as I showed
in a prior post.

Another option would be to use Perl's $^I ( $INPLACE_EDIT ) and loop
through the file line-by-line.

A third option would be to load the file into an array and then reopen
the file in write mode and loop through & process the array outputting
it to the file.

I'm sure I can come up with other viable options, but I think those
are the most common approaches.


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

Date: Tue, 30 Sep 2008 06:41:40 -0700 (PDT)
From: pgodfrin <pgodfrin@gmail.com>
Subject: Re: File edits in a Perlish way
Message-Id: <2db83ab4-169b-46a0-8d6d-ce9261029a46@d70g2000hsc.googlegroups.com>

On Sep 29, 3:04=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth pgodfrin <pgodf...@gmail.com>:
>
>
>
> > I have a need to pass a series of "edits" I'd like to apply in a
> > somewhat controlled manner.
>
> > My pseudo code would be something like:
> > 1. accept as input the file name, old text, new text
> > 2. check existence in file for old text, if not found error out
> > 3. if found, then show before and after text for the whole line
> > 4. Write out file.
>
> > I'm currently using @ARGV for #1 and I intend to slurp the whole file
> > into an array and then use map for #4.
>
> > I'm looking for ideas on a "perlish" way to do #2 and #3. The grep
> > function lets me show before and after like so:
>
> > =A0 =A0 print grep(/$oldtx/,@oldfile);
>
> =A0 =A0 my @lines =3D grep /\Q$oldtx/, @oldfile
> =A0 =A0 =A0 =A0 or die "'$oldtx' not found\n";
> =A0 =A0 print @lines;
>
> --
> 'Deserve [death]? I daresay he did. Many live that deserve death. And som=
e die
> that deserve life. Can you give it to them? Then do not be too eager to d=
eal
> out death in judgement. For even the very wise cannot see all ends.'
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0b...@morrow.me.uk

Ben,
Nice to hear from you again. And, once again, you da man...

I think Ron, that you are right, I 'm looing for compact code.
Nevertheless, simplicity is in the eye of the beholder. In my OP I
mentioned that I could do this using "loops and other brute force
methods" - the implication that loops are a brute force and therefore
not elegant. I apologize for that implication. In general I am not
opposed to using loops - I just didn't want to do that this time. But
to be fair, the grep and map functions already use loops and return
count values - which does kinda the same thing your code does below.

smiles,
pg

"Frodo Lives!"


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

Date: Tue, 30 Sep 2008 09:09:19 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: File edits in a Perlish way
Message-Id: <slrnge4cof.ior.tadmc@tadmc30.sbcglobal.net>

Bernie Cosell <bernie@fantasyfarm.com> wrote:

> Processing a file in-place [as he said he wants to do, since his
> pseudo-code didn't include an output file] is pretty tricky to do line by
> line, no?


No. 

eg: Add line numbers to a file in-place:

   perl -p -i -e 's/^/$. /' some.file

not at all tricky.


What _is_ trickier is applying multi-line edits in-place (which
is why the question was asked).


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


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

Date: Tue, 30 Sep 2008 04:27:31 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Help: Match Error
Message-Id: <3ui8r5-guv.ln1@osiris.mauzo.dyndns.org>


Quoth Amy Lee <openlinuxsource@gmail.com>:
> On Mon, 29 Sep 2008 19:32:31 -0700, Jürgen Exner wrote:
> > 
> > The minus sign is not a digit.
> > 
> Thanks. And I have noticed that, however if I want to match 
> dG = 30 and dG = -30, what RE should I take?
> Use /dg =( | -)(\d+)/ ?

That will work. It would be better to use non-capturing brackets:

    /dg =(?: | -)(\d+)/

and you don't need the space inside the alternation:

    /dg = (?:|-)(\d+)/

and you can just use ? instead:

    /dg = -?(\d+)/

Ben

-- 
           All persons, living or dead, are entirely coincidental.
ben@morrow.me.uk                                                  Kurt Vonnegut


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

Date: Tue, 30 Sep 2008 07:33:33 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Help: Match Error
Message-Id: <slrnge474t.ior.tadmc@tadmc30.sbcglobal.net>

Amy Lee <openlinuxsource@gmail.com> wrote:

[ snip how to match a real number ]

> Thank you very much. You show me the way.


You needn't be so dependent on others to show you the way.

You will become an efficient Perl programmer if you learn how
to discover "ways" for yourself.

If you have a question about "numbers", you should check the
Frequently Asked Questions that mention them:

   perldoc -q number

        How do I determine whether a scalar is a number/whole/integer/float?

which has 7 patterns for matching various types of numbers.

Then you would have noticed that many of the patterns have "-" character
in them, and that your pattern did not...

 ... problem solved without asking hundreds of other people to do it for you.

Be nice to us.


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


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

Date: Tue, 30 Sep 2008 08:57:35 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Help: Process many files at the same time
Message-Id: <slrnge4c2f.ior.tadmc@tadmc30.sbcglobal.net>

Amy Lee <openlinuxsource@gmail.com> wrote:


> foreach $file (@ARGV)


Why do you think you need this foreach loop?

(hint: where does your program make use of the $file variable?)


> {
>   while (<>)


The diamond operator (<>) opens a file (for reading) for you.


>   {
>     chomp;
>     if (/(\d+)\s+dG = (-?[\d.]+)\s+(.*)/)
>     {
>       $total = $1;
>       $name = $3; 
>       s/.*//;


What is in $_ at this point in your program?

(hint: print it out here.)


>     }
>     $g += tr/C//;
>     $c += tr/G//;


What string is the tr/// operator operating on here? (Answer: the string in $_).

What is in $_ at this point? (Answer: either the empty string or a newline).

How many "C" characters are there in $_ (Answer: zero).

Repeatedly adding zero to a number will not likely lead to useful results...


>   }
>   $gc = $g+$c;
>   $GC = $gc/$total;


I anticipate that you will run into yet another Frequently Asked Question,
so let's get that out of the way right now:

   perldoc -q 999

        Why am I getting long decimals (eg, 19.9499999999999) instead 
        of the numbers I should be getting (eg, 19.95)?

and

   perldoc -q round

        Does Perl have a round() function?  What about ceil() and floor()?  
        Trig functions?


>   print "$name\t$GC\n";


Since you have not provided a filehandle to print(), all of the output
will go to the default stream (STDOUT).

If you want to write to a file, you must open() it for writing,
and use the filehandle that the open() set up for you, eg:

    open my $OUTFILE, '>', "$file.new" or die "could not open '$file.new' $!";
then
    print $OUTFILE "$name\t$GC\n";


> }
> Then I hope I can get a list of the result because I use "foreach" to
> process many files I gave at the same time. However, It just output one
> file and the output variable $CG is wrong. If I run this to process one
> file, it could work well.


perl will handle all of the reading from one file then writing to
another file for you.

See the -i switch in perlrun.pod and the $^I variable in perlvar.pod.


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


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

Date: Tue, 30 Sep 2008 15:44:33 +0200
From: Marten Lehmann <lehmannmapson@cnm.de>
Subject: how to replace $1, $2, $3 ...
Message-Id: <6keoq4F7jr2aU1@mid.individual.net>

Hello,

I have a regular expression, which returns several values in $1, $2, $3 
and so on. How can I simplify an assignment like this:

($one, $two, $three) = ($1, $2, $3);

This term does not work:

($one, $two, $three) = @_;

Regards
Marten


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

Date: Tue, 30 Sep 2008 07:14:48 -0700 (PDT)
From: Paul Lalli <mritty@gmail.com>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <575262bf-0b06-475b-b152-a8c16b60be35@e17g2000hsg.googlegroups.com>

On Sep 30, 9:44=A0am, Marten Lehmann <lehmannmap...@cnm.de> wrote:
> Hello,
>
> I have a regular expression, which returns several values in $1, $2, $3
> and so on. How can I simplify an assignment like this:
>
> ($one, $two, $three) =3D ($1, $2, $3);
>
> This term does not work:
>
> ($one, $two, $three) =3D @_;

Of course it doesn't.  Why would it?  @_ has absolutely nothing to do
with regular expressions.


Just do your regexp in list context rather than scalar context.

ie, rather than:
if ($string =3D~ /(foo)(bar)(baz)/) {
   ($one, $two, $three) =3D ($1, $2, $3);
   #stuff with one, two, three
}

just do:

if (($one, $two, $three) =3D ($string =3D~ /(foo)(bar)(baz)/)) {
   #stuff with one, two, three
}

Paul Lalli


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

Date: Tue, 30 Sep 2008 16:23:43 +0200
From: Marten Lehmann <lehmannmapson@cnm.de>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <6ker3iF7ig85U1@mid.individual.net>

> Just do your regexp in list context rather than scalar context.

Thanks, but this works only in a context of a known set of matches. But 
how can I work on an unlimited number of matches like this:

if ($string =~ /(\w )*/) {
	...
}

?

Regards
Marten


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

Date: Tue, 30 Sep 2008 09:18:59 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <slrnge4daj.jqi.tadmc@tadmc30.sbcglobal.net>

Paul Lalli <mritty@gmail.com> wrote:
> On Sep 30, 9:44 am, Marten Lehmann <lehmannmap...@cnm.de> wrote:
>> Hello,
>>
>> I have a regular expression, which returns several values in $1, $2, $3
>> and so on. How can I simplify an assignment like this:
>>
>> ($one, $two, $three) = ($1, $2, $3);
>>
>> This term does not work:
>>
>> ($one, $two, $three) = @_;
>
> Of course it doesn't.  Why would it?  @_ has absolutely nothing to do
> with regular expressions.
>
>
> Just do your regexp in list context rather than scalar context.
>
> ie, rather than:
> if ($string =~ /(foo)(bar)(baz)/) {
>    ($one, $two, $three) = ($1, $2, $3);
>    #stuff with one, two, three
> }
>
> just do:
>
> if (($one, $two, $three) = ($string =~ /(foo)(bar)(baz)/)) {
>    #stuff with one, two, three
> }


Even better, restrict the scope of the variables too:

    if ( my($one, $two, $three) = ($string =~ /(foo)(bar)(baz)/)) {
        #stuff with one, two, three
    }

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


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

Date: Tue, 30 Sep 2008 16:45:06 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <gbte1h$am9$1@nntp.fujitsu-siemens.com>

Marten Lehmann wrote:
>> Just do your regexp in list context rather than scalar context.
> 
> Thanks, but this works only in a context of a known set of matches. But 
> how can I work on an unlimited number of matches like this:
> 
> if ($string =~ /(\w )*/) {
>     ...
> }

As Paul pointed out, "Just do your regexp in list context rather than 
scalar context.", so

use warnings;
use strict;

my $a = "12 34 56 78 90";
if (my @v = ($a =~ /(\d\d)/g)) {
print join("\n", @v), "\n";
}

Josef
-- 
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html


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

Date: Tue, 30 Sep 2008 14:45:59 +0000 (UTC)
From: comps@riffraff.plig.net (Vicky Conlan)
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <gbte37$15mj$2@magenta.plig.net>

According to <lehmannmapson@cnm.de>:
>Thanks, but this works only in a context of a known set of matches. But 
>how can I work on an unlimited number of matches like this:
>
>if ($string =~ /(\w )*/) {
>	...
>}

Same answer, just use an array?

my $moo = "a b c d e f"; 
my @wibble = ($moo =~ /(\w)/g); 
print Dumper(\@wibble)'

$VAR1 = [
          'a',
          'b',
          'c',
          'd',
          'e',
          'f'
        ];
-- 


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

Date: Tue, 30 Sep 2008 09:42:47 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <slrnge4en7.jr0.tadmc@tadmc30.sbcglobal.net>

Marten Lehmann <lehmannmapson@cnm.de> wrote:
>> Just do your regexp in list context rather than scalar context.
>
> Thanks, but this works only in a context of a known set of matches. 


Using a regex in list context works whether you know how many
matches there will be or not.

If you want to save an unknown number of variables, than save
them in an array instead of a list of individual scalar variables.

If you want the pattern to match more than once, then use the m//g modifier:

    if ( my @matches = $string =~ /(\w+)+/g ) {


> But 
> how can I work on an unlimited number of matches like this:
>
> if ($string =~ /(\w )*/) {


That match is completely useless. It will match *every* string, so it
will always return true, so the if-block will always execute.

It is an "unconditional conditional"...

Maybe you meant /(\w )+/ instead?

Probably not, as that would not match the "z" if $string = 'foo bar baz'
since it requires a space following the word char.

You probably want a "run" of word chars rather than a single word char too?


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


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

Date: Tue, 30 Sep 2008 16:00:57 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <48e23f2c$0$26087$db0fefd9@news.zen.co.uk>


Marten Lehmann wrote:
>> Just do your regexp in list context rather than scalar context.
> 
> Thanks, but this works only in a context of a known set of matches. But 
> how can I work on an unlimited number of matches like this:
> 
> if ($string =~ /(\w )*/) {
>     ...
> }
> 

Maybe

$ perl -e '
for $w ("aa aa aa","bb bb bb bb","cc cc cc cc cc") {
   if ( (@w)=($w=~/(\w )/g) ) {
      print "[", join("|",@w), "]\n";
   }
}'
[a |a ]
[b |b |b ]
[c |c |c |c ]


-- 
RGB


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

Date: Tue, 30 Sep 2008 17:06:14 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: how to replace $1, $2, $3 ...
Message-Id: <87wsgtzna1.fsf@hacking.dk>

Marten Lehmann <lehmannmapson@cnm.de> writes:

> I have a regular expression, which returns several values in $1, $2,
> $3 and so on. How can I simplify an assignment like this:
>
> ($one, $two, $three) = ($1, $2, $3);

Quite obfuscated and only almost equivalent:

$var =~ m/$re/;
($one, $two, @rest) = map { substr($var, $-[$_], $+[$_] - $-[$_]) } 1 .. $#-;

Some extra work may make it more equivalent with the original (test
for definedness of $-[$_]) but this only makes it even more obscure
nad I'm not convinced taht it doesn't contains other quirks.

I guess there is a special level of hell reserved for people using
this in production code.

//Makholm


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

Date: Tue, 30 Sep 2008 08:15:11 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: How to unable the use of tainted mode in a CGI script ?
Message-Id: <lu54e4p0nv7106u1pj4m7d713la0i9spum@library.airnews.net>

Azol <azol@non-non-non> wrote:

} I have to use a long perl script which use the "tainted mode" (-T 
} option), but the hoster we use doesn't allow this option unless on 
} dedicated server (and, of course, we can't pay a dedicated server). 
} 
} What I have to do to remove the tainted mode in the script ? 

One possibility: could you finesse this problem by invoking Perl yourself,
directly?  I could see something like having a tiny bit of perl that read
from __END__ to the end of the file, stored it in /tmp, and then you could

  "exec perl -T <tmptfile>"

Ugly and klunky, but it might get you taint-mode back...

   /Bernie\

-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Tue, 30 Sep 2008 04:56:05 -0700 (PDT)
From: somyasharma@gmail.com
Subject: Sybase::CTLib ct_connect problem
Message-Id: <fa04833a-1b58-4fa6-9477-a89a3f3b66ca@m3g2000hsc.googlegroups.com>

Hi,

I am trying to use SyBase::CTLib with perl 5.6 and sybase ASE 12.5. i
was trying a simple script to start of.

but, my script exits with this error :

Open Client Message:
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (191)
Message String: ct_connect(): user api layer: external error: The
connection failed because of invalid or missing external configuration
data.


Can any one help in this regard? i have checked the existence of
external dependency file (ocs.cfg) in the directory $SYBASE/
$SYBASE_OCS/config.

Looking for inputs.

Regards,
Somya Sharma


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

Date: Tue, 30 Sep 2008 07:02:08 -0700
From: Peter Scott <Peter@PSDT.com>
Subject: Re: use Class::Std :ATTR
Message-Id: <pan.2008.09.30.14.02.06.831455@PSDT.com>

On Mon, 29 Sep 2008 22:04:30 -0500, * Tong * wrote:
> On Sun, 28 Sep 2008 05:09:27 -0700, Peter Scott wrote:
> 
>>   my %name_of :ATTR(:get<name>, :set<name>)
> 
> thanks. 
> 
> About the comma after get, the man pages doesn't have commas between :get 
> and :set. But I've also see other places including the commas. What's the 
> correct way?

No comma is more correct because that is what the docs say, so I should
have removed the comma.  But the parsing engine just look for the colon so
you could put

  my %name_of :ATTR(:get<name> hi mom :set<name>)

and it would still work.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/



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

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


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