figure out why. In the output all the lines
are printed twice, where I expect them to appear only once. The totals are
calculated correctly.
So if anyone here can help me, that would be very much appreciated
thanks, jean
>
Op vrijdag 4 november 2005 16:24, schreef Jeff 'japhy' Pinyan:
> > #!/usr/bin/perl
> > #
> > # webstore-rijselect-5-werkt.pl
> > #
> > use warnings;
> > use strict;
> >
> > use integer;
column in my sql table to identify the each row. I'll take a look at
this, because something in the back of my mind says there must be cleaner
ways to to this
you wrote:
> > foreach (my @result = $sth->fetchrow_array) {
>
> That is certainly incorrect. I think you just want t
"$t_qty[$i]\n";
}
else {
print "$sku[$i-1]",', totaalaantal is ',
"$t_qty[$i-1]\n";
}
}
}
}
}
$sth->finish;
$dbh->disconnect;
__
regards, jean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
I'd like:
$val[0]="a", $val[1]="bcd, efg, h", $val[2]="c" (or equivalent).
I cannot figure out how to use split when the delimiter is the double quote.
Thanks for your help.
Jean-Louis
Hello José,
Unfortunatel
-Message d'origine-
De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]
Envoyé : mardi, 11. mai 2004 16:27
À : BERTHOLD Jean; [EMAIL PROTECTED]
Objet : RE: Problem using File::RsyncP module
> -Original Message-
> From: BERTHOLD Jean [ma
Hello José,
Unfortunately, these different syntax don't work ...
Perhaps I will ask directly to the module's author to find what is wrong in my code.
Thanks again for your help !
Jean
-Message d'origine-
De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]
Envoyé : mardi,
7
Then, the connection is established but no files transfered ...
My script is a copy-paste (adapted to my servers, of course...) from the
source given in the perl documentation.
Of course, I could do
this job using system('rsync...') command line but I would like to do this
script multi - OS ...
Can you see what is wrong ?
Thanks for your help and have a nice day
EOS
Holding
Jean Berthold
Administrateur Unix & Oracle
Unité Gestion de l'infrastructure
Team Systèmes
Ch. de Mornex 10
Tél. +41(0)21 341 24
58
Fax +41(0)21 341 20 49
jean.berthold@eosholding.ch
<>
with DBI/DBD modules
...
Below the sqlplus
output when I apply archivelogs manually.
I cannot use automatic recovery because I
use Oracle Standard Edition
Thanks for your help
and have a nice day !
Jean
Berthold
[EMAIL PROTECTED] [PWJA] # sqlplus /nologSQL*Plus: Release 9.2.0.4.0 -
Product
have a nice day !
E O S H o l d i n g
Jean Berthold
Administrateur Unix & Oracle
Unité Gestion de l'infrastructure
Team Systèmes
Ch. de Mornex 10
Tel +41 21 341 24 58
Fax +41 21 341 20 46
[EMAIL PROTECTED]
--
Nom du fichier: rman_APPEOS-archivelog-05-10-05-0100.log
Instance Oracle: APPEOS
Thanks for your help !
Jean
-Message d'origine-----
De : Muthukumar [mailto:[EMAIL PROTECTED]
Envoyé : mercredi, 5. octobre 2005 12:21
À : BERTHOLD Jean
Cc :
Yes,
It's working now !
I didn't find any example like your's in the documentation.
Thanks again to everybody for your help !
Jean
-Message d'origine-
De : Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]
Envoyé : mercredi, 5. octobre 2005 13:13
À :
ind the configuration file ...
Thanks for your help
EOS Holding
Jean Berthold
Administrateur Unix & Oracle
Unité Gestion de l'infrastructure
Team Systèmes
Ch. de Mornex 10
Tél. +41(0)21 341 24 58
Fax +41(0)21 341 20 49
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTE
the field blank the '-j3' parameter is the default ...
My machine is bi-processor under Solaris 9.
I tried to edit by hand the file:
/usr/perl5/5.6.1/lib/CPAN/Config.pm
But unsuccessful.
An idea ?
Thanks again
Jean Berthold
-Message d'origine-
De : Wiggins d Ancon
Hi,
try: which perl
at the command prompt, it will reply something like
/usr/bin/perl (the path to perl executable)
then get sure the first line in checkit.pl is
#!/usr/bin/perl -w
or whatever the which command reply.
Regards.
Karin Friberg a écrit :
>
> Hi there!
>
> When I run my perl program
Hi, all
Do someone knows about a perl module to convert PDF files to postscript
?
I'm working on several UNIX (AIX) boxes and want to 'automagically'
print PDF files.
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
when you get $s from STDIN, it comes along with a newline,
so try something like: chomp($s = );
A+
Gajo Csaba a écrit :
>
> Hi, I have a problem with SWITCH. I wrote this, I think
> it's clear to anzone what it should do:
>
> print "Type in a number 1-5: ";
> $s = ;
> SWITCH;
> {
> if ($s
Hi,
try this :
#!/usr/bin/perl -w
use strict;
sub Usage() {
die "Usage: $0 \n";
}
$_ = shift;
Usage unless ((defined $_) && (/^server(\d+)\.(\w+)$/));
print "param is $_\n";
---
take a look at perlre.
A+
Jose Malacara a écrit :
>
> I would like to be able to verify the presence and syntax of
Hi,
the second line is simply declaring two variables:
1 - the scalar $itemtype
2 - the hash %symbol
just another way to say
my $itemtype;
my %symbol;
no magic here, *NOT* a list or data structure.
A+
David Buddrige a écrit :
>
> Hi all,
>
> I am reading through a collegue's perl script. In it
try this:
#!/usr/bin/perl -w
use strict;
my $if = "path_to_input_file";
my $of = ">path_to_output_file";
my ($name, $addr);
open(IF, $if) or die "Can't open file $if for reading\n";
open(OF, $of) or die "Can't open file $of for writing\n";
while () {
chomp;
(undef,$name,undef,undef,undef,unde
Hello,
I suggest this:
#!/usr/bin/perl -w
use strict;
my $var1 = "23456789";
my $var2;
($var2 = $var1) =~ s/(\d)/$1 /g; # only add 'g' for global substitution
print "var1 = '$var1', var2 = '$var2'\n";
Regards.
Paul Murphy a écrit :
>
> Hello, this is a two part question: a how to, and a how
I would suggest Stat/Transfer, www.stattransfer.com or DBMS/Copy.
Best,
Jean Roth
National Bureau of Economic Research
www.nber.org/data
Date: Thu, 6 Feb 2003 11:30:19 -0500 (EST)
From: Benjamin Jurado <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: sasdata set
can anyone point
on't know where is the benefice to use perl instead
of shell scripts for theses tasks...
Thank for your help and have a nice day !
--
Jean Berthold
EOS - energie ouest suisse
Chemin de Mornex 10 , CP 570
CH-1001 Lausanne , Switzerland
Tel. : +41 (0)21 341 24 58
Fax : +41 (0)21 341 20 49
E-Mail : [EMAIL PROTECTED]
e key and in a second loop the backup path.
Is it possible ?
for example, second loop :
while ($key) = each %Slice )
{
$Slice{$value} = `fssnap -i $key | grep /dev/fssnap | cut -c 33-45` ;
}
What is wrong ?
Thanks for your help
--
Jean Berthold
EOS - energie
:-)
All theses information will be used later to generate reports and alarm by
email.
Is it possible to implement this idea in a perl script ?
Thanks again for your help and have a nice day.
Jean Berthold
Jeff 'japhy' Pinyan a écrit :
> On Jul 29, Jean Berthold said:
>
> &
If you are generating the email CGI form on the fly,
you can pass the number as a hidden INPUT field :
eg:
... INPUT fields as needed
Hope it helps.
Ben Crane a écrit :
>
> Hi List,
>
> I have an online web map created through mapinfo-when
> you click on a part of the JPEG image it lo
Not an expert in perl (nor in english), but let's try ;-)
if your output file is not supposed to get too big,
consider 'writing' first your output lines in a hash
... $hash{1} = "line 1"; and so on
(later, writing line 10 for eg.)
if (whatever)
{
$hash{5} .= " these few words";
}
when finished,
Hi, pravesh
1 - You are saying "mv <
> HI
> I define a file the following way:
>
> $FILE_HANDLE = "<
> then I openit
>
> open(FILEHANDLE);
>
> i perform some operations..
>
> and then I want to transfer this "somefile" to some other directory
>
> but I am not able to use mv comand to do i
Hi,
I've downloaded Tie::File module from
http://search.cpan.org/author/MJD/Tie-File-0.93/
and given it a little try : works fine.
(even for me : Just Another Perl Newbie).
Thanks, José.
"NYIMI Jose (BMB)" a écrit :
>
> Why not just use Tie::File module ?
>
> http://search.cpan.org/author/JHI
Hi,
$num += $num % 2;
this increments $num if $num modulo 2 is 1
(ie. if $num was odd)
regards.
"Zielfelder, Robert" a écrit :
>
> Greetings,
>
> I am trying to write a script that at one point needs to look at a number
> and divide it by two. The results must always be an integer, but the
Hi, James
Can you post some examples ?
- what do you call the header in your files,
- what string(s) are supposed to match what,
- what is the data to write to output file(s)
and so on...
Rgds.
James Parsons a écrit :
>
> Hi all
>
> Perl Is extremely new to me and I'm having a problem were to s
Hi, Alex
i suggest the following:
#!/usr/local/bin/perl -w
my $filename = "Your_file_name";
# if you are so lucky to work on Unix
my $lastline = `tail -1 $filename`;
print $lastline;
# if file is small enough to hold in an array
open(FILE, $filename) or die "Can't open $filename.\n";
my @array
Hi, Christophe
I suggest the following (see attached file: modcfg)
Hope this helps.
folschette a écrit :
>
> hi again,
> and which i forgot to say: while merging file1 into file2 , no key should be
> double, the right key is the one in file1!!
>
> so in fact it is a replacement of some lines i
Hi,
try this :
my $last = (glob("fred.*"))[-1];
---
- $last gets the last item in the array returned by glob()
- glob() returns file names sorted alphabetically ;-)
Regards.
Ken Cole a écrit :
>
> Hi,
>
> I have a directory in which there are files such as:
>
> fred.1
> fred.2
> fred.3
>
> T
gt; Could anyone please give in any suggestions.
>
> Thanks,
> Prachi
--
Jean-Matthieu Guerin
Brime Ingenierie
[EMAIL PROTECTED]
> Systems Engineer
> McGraw-Hill Education
> McGraw-Hill Companies
> 860-409-2603
> [EMAIL PROTECTED]
--
Jean-Matthieu Guerin
Brime Ingenierie
phone: 33-1-4898 8230
[EMAIL PROTECTED]
AIL PROTECTED]
> http://www.mcnabbs.org/evan
>
--
Jean-Matthieu Guerin
Brime Ingenierie
[EMAIL PROTECTED]
t; understanding this?
>
> --
> Thanks and Regards,
> D.Rajanikanth
--
Jean-Matthieu Guerin
Brime Ingenierie
phone: 33-1-4898 8230
[EMAIL PROTECTED]
> chomp $ans;
>if ($ans eq "y"||$ans eq "Y") {
>
>
> Anyone got a quick example before I start digging into the sites? I am sure
> I could do the whole thing more efficiently, but for now I'd like to stick
> with my baby steps. I am
How can I get the URL which was calling my script (like
document.referrer in Javascript)
tks
It was all I need
Thank you
Stéphane JEAN BAPTISTE a écrit :
> How can I get the URL which was calling my script (like
> document.referrer in Javascript)
>
> tks
How can I delete a file ?
thanks
It's allright!
thank you
Stéphane JEAN BAPTISTE a écrit :
> How can I delete a file ?
>
> thanks
HI.
I'm looking for a method to delete the line number x into a file.
Is it simply possible ?
tks
Hi.
Hw could I copy a file in Perl
tks
Hi!
I get a value from a URL and I put it into a variable.
I have a loop (while) with a value which have different values.
The problem is that when I compare the first and the second value: If
they're really equals, the program say they are'nt.
Is ther a function to convert a value into an inte
This is my code :
/^valeur=/ && do {
$val=$_;
$val=~s/valeur=//;
};
open(IN,"actualite.txt");
open(OUT,">>tamp.tmp");
$i=1;
while ( $line = )
{
if ( $i != $valeur )
{
print OUT $line;
};
$i++;
}
close IN;
close OUT;
What is chomp ?
tks
Hi.
I want to replace the String %0A by nothing. I'm using this line:
$description=~tr/%0A//;
But nothing change.
What is my problem ?
tks
Stéphane JEAN BAPTISTE a écrit :
> Hi.
> I want to replace the String %0A by nothing. I'm using this line:
>$description=~tr/%0A//;
>
> But nothing change.
>
> What is my problem ?
>
> tks
PS: There is'nt only 1 string but a lot.
I have a variable and I want to write it into a textarea (HTML). The
problem is when I look at the textarea in my HTML page, there is the
text I want, plus a trailing newline.
How can I delete this.
My variable:
"$texte="wazaa";"
In textarea:
"wazza
"
tks
Sorry for my english
steph
"Brett W. McCoy" a écrit :
> On Wed, 27 Jun 2001, Stéphane JEAN BAPTISTE wrote:
>
> > I have a variable and I want to write it into a textarea (HTML). The
> > problem is when I look at the textarea in my HTML page, there is the
> > text I want, plus a trailing
Hi
I want to delete a string but only the last.
Example/
I am the titi last human on titi earth.
-> I want to erase the last "titi" nut not the other.
How can I do this
thanks
Hi
I need the (hexa?) code for trailing newline, but not "\n". I need a
code like (é or é for é)
tks
HI.
On the first side, I have a line of text into a file.
On the other side, I want to write this text in a "textarea" Tag.
In the text which is coming from the file, I have "\n", to have a trailing
newline.EX: "First line \n Second Line".
I get the text from the file and I put it into the variab
Hi,
Can you explain me how can I convert an hexadecimal number in decimal ?
For converting decimal in hexadecimal, I can use the function hex, but I
didn't find a function for converting hex in dec.
Thanks in advance,
Jean
I wrote a perl script to make a FTP connection to a remote machine like this
#
#!/usr/local/bin/perl
open (FTP, " | ftp -v -n remote.comp.fr");
print FTP, "user username passwd\n";
print FTP, "bin\n";
print FTP, "prompt\n";
print FTP
I'm trying to get my apache web server up and running but everytime I try I
get a perl error about locale settings. I have tried a few things to get it
to work but none worked.
I'm using RH7.1, and have setup japanese language support (japanese kb,
sometimes I input japanese) with:
Apache/1.3
I'm trying to get my apache web server up and running but everytime I try I
get a perl error about locale settings. I have tried a few things to get it
to work but none effective.
I'm using RH7.1, and have setup japanese language support (japanese kb,
sometimes I input japanese) with the folow
What's the equivalent command for "return 0" in C/C++.
This command allow you to stop your program immediately.
tks
How can I have the URL which is calling my script?
ex:
the name of my script is : "script.cgi"
URL is : http://www.computer.com/script.cgi?toto=12&titi=25
I want to have $var=toto=12&titi=25 or $var=http://iti=25 .
tks
I'm looking for a command which permit to reach an URL from the script.
tks
PS: sorry for my english :-)
I don't understand the difference between these two functions: find and
finddepth in module File::Find. I don't understand the explanation in
perldoc. My experience shows that finddepth is about 50% faster than find.
Why ?
Thanks in advance,
Hi,
I found a simple perl hotline bot, and when I try to launch it, it says
that the system command stty is not found!
I know it is a shell util under linux, but what is the equavalant system
utility under win2k?
Thanks for your answer
--
Christophe Tréfois ([EMAIL PROTECTED])
Web-Development
y the
digits from on the left as well as the periods. More complex question: If I
have something like "src=206.48.16.3/12345", how can I do the same as bove,
but also removing the "src=" at the beginning ?
Thanks :-)
Jean-Francois Messier
Ottawa, CANADA
-Origina
could run
Perl under Windows, but that sounds like a non-sense to me. Since I have a
Linux station, I might as well take advantage of it. I think this command
can be very useful, but I first need it to run properly.
Thanks :-)
Jean-Francois Messier
Ottawa, CANADA
--
To unsubscribe,
Hi,
A little problem I encountered recently.
I have an array of integers and two indexes within
that array. I need to get another array identical
to the first one, except that all cells between
the two indexes (inclusive) must be compressed to
one column which is the sum of the originals
cells.
* Paul Lalli [2008.06.19 13:52]:
> On Jun 19, 11:41 am, [EMAIL PROTECTED] (Jean-Rene David) wrote:
> > I have an array of integers and two indexes within
> > that array. I need to get another array identical
> > to the first one, except that all cells between
> > the t
Hi,
A little problem I encountered recently.
I have an array of integers and two indexes within
that array. I need to get another array identical
to the first one, except that all cells between
the two indexes (inclusive) must be compressed to
one column which is the sum of the originals
cells.
* Telemachus [2008.10.15 12:35]:
> In Debian (and so probably many of its
> children), perl-doc is a distinct package and
> not installed automatically when you install the
> perl package.
>
> Stupid, but true.
Well, not to drift off-topic but it is my
understanding that it is general Debian poli
Hello,
> It looks like not all of the fields have something in them. Perl is taking
blanks for
> undefined for some reason.
An empty field in a database is not a "blank", as you say, but a NULL.
Meaning it's not just blank, but effectively inexistant - there is no value,
not even the empty strin
Hello Joseph,
>> String[] aStr = {"-e", "'print(\"Ola\n\") foreach
(1..100);'"};
>>
>> Process p = r.exec("perl", aStr);
>
> You told the system to open the perl compiler here. You may also have
Offered
> it 100 lines like this:
> "Ola
> ""Ola
> Which Perl would have a ver
Hello Mike,
> $row=$dbh->prepare("SELECT contact_id,first_name,last_name,organisation
> FROM tb_contacts WHERE organisation ILIKE ?");
[...]
> while(($id,$first_name,$last_name,$organisation) = $row->fetchrow_array())
{
[...]
> $row=$dbh->prepare("SELECT id,contact_id,type_of_contact,priority
Hello Mike,
> Do we know where I can get a clear definition
> of "query_string"?
[and in another message...]
> Is there any place we can look up the definition
> of these such as "CONTENT_LENGTH" & query_string.
I'm not sure why you're asking here for something like that. You can use
Google t
Hello Joe,
> i have the following code:
>
> $sth = $mysql_dbh->prepare("select subroutine_pointer from
> $database.equipment_manufacturer where
> manufacturer=\"$remedy_eqpt_mfgr\"");
> $sth->execute();
> $subroutine_pointer = $sth->fetchrow_array();
> no strict "refs";
>
Hello,
> mike wrote:
>
> > When I do Search in the web-browser, is there any way to get it to
> > search the values in the fileds of the form?
> >
> > Currently all the values show up, but they dont seem to
> appear to be in
> > scope for searching
>
>
> Show some code -- likely your logic is
Hello Jason,
> $VAR1 = {
> 'oids' => '%response_values',
> 'time' => '03/25/2004 03:16:39'
> };
...
> If so, what is wrong with my assignment statement ?
>
> push @{$response_hash{$request_id}},{time => "$time",oids =>
> "%response_values"};
That is exactly what Charl
Hello Andrew,
> Is there a way to find out how many records were returned
> with a DBI query? There's the
> obvious counting each record as you fetch it, but I need the
> count before I start going
> through them.
I was looking through the DBI documentation (perldoc DBI) not long ago and
this
Hi again Andrew,
> With the mysql driver, it does return the number of fetched
> rows before you start
> iterating through them. It does what I need it to do. Thanks.
Ok, but that behaviour is probably specific to DBD::MySQL, and can't be
relied upon if you change to another DBD... I would use
come from the relatively new school of programming.
As I understand, they are features of the language that are dangerous to use
in some contexts, so use strict disallows them knowing that if you really
want to use them, you'll disable strict for the block of code where you use
it, and then re
Hello Derek,
> Guay,
Err, my first name is Jean-Sebastien. My last name is Guay. French-language
people have a bad habit to put the last name first, as in "Guay,
Jean-Sebastien"... So I understand why this is a bit confusing.
> What do you mean when you say "Just use $
> Guay Jean-SÃbastien wrote:
>>
>>> open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!";
>>
>> As I said, you should replace || by or in the above line. See the
>> precedence rules in "perldoc perlop" for de
Hello Derek,
> can I email you from know on??? : ) You are so through! Thank you!
No, I would prefer that you always reply to the list. First reason is that
other beginners can benefit from our exchange (and the mails end up in a
searchable archive), second is that if I'm not there (or for th
I am sorry David, it just seems like I am having trouble communicating
clearly. We are apparently in a disagreement, but your points are not at all
what I wanted to explain... I'll try again.
> you should test it yourself. i am not sure how good you are
> with Perl and i
> don't want to sound lik
Hello Joseph,
> One thing I would request is that you trim off any material to which you
are not
> responding from old posts. This helps keep bandwidth and storage needs
down.
I'll keep that in mind. I usually don't keep all the thread of replies that
Outlook ( grrr) keeps at the bottom, seems l
Hello Joseph, David,
> A stronger argument has to do with mindset. The || operator is an
> expression evaluation operator, appropriate to mathematical or
paramathematical
> expressions. The context really calls for a flow-control operator, or.
Thanks for making my point better than I could, Jos
Hello Romain,
> sub n_list {
>
> my($a)[EMAIL PROTECTED];
>
> ...sql query...
>
> my $sth=$dbh->prepare($sql);
> $sth->execute();
>
> my node_l;
As others have noted, this should be @node_l, but you say it's that way in
your code (why didn't you just paste your code btw? Would have avoided su
Hello Greg,
> Thanks for you comments. Is this the best way then? Seems to work, but
I'm
> curious what could be any better..
Your version is fine. Here's mine, just so you have another take on how to
do some things. Among a few other things, I added checking for so that the
guess has to be a
Hello Jakob,
> I'm trying to create a script with where you can put a flag to the script
or
> not
> fx run it like:
>
> script -h
> or just
> script
I would use one of the Getopt::* modules, because parsing command line
options is something very standard, and as you add more and more options,
th
uld get the right page,
as I did.
J-S
___
Jean-Sébastien Guay [EMAIL PROTECTED]
http://whitestar02.webhop.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
ils.
Good luck,
J-S
--
__
Jean-Sébastien Guay [EMAIL PROTECTED]
http://whitestar02.webhop.org/
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 2004/12/15
--
To u
scape sequence.') Or, use
slashes instead of backslashes. That works great. Or you can also use a
single-quoted string instead of double-quotes, which means Perl won't
try to interpolate anything in the string.
Once you do that, it will work fine.
J-S
--
_____
mically launched on the target system. I also get logs
on the target that prove this.
Any idea, the "core" of the script is attached below (some meaningless
instruction about local or remote network interfaces
activation/configuration/de-activation have been left aside, as well as
de
* Rob Dixon [2007.03.30 08:30]:
> - You could add Lua to the list. But then remove
> it - it's awful.
FYI, I have read much harsher comments about perl
on the lua mailing list.
I ignored them at the time and will do the same
here, though I wouldn't mind hearing more
substantive criticisms. That i
* Chas Owens [2007.04.09 11:00]:
> > for (my $i = 0; $i < @banks; $i++)
>
> If you must loop this way at least do it like this:
>
> for my $i (0 .. $#banks) {}
>
> But most likely you don't need to loop that way and it is better to
> loop this way:
>
> for my $bank (@banks) {}
I've been
Hi,
I launch a script through rsh (or ssh) and it hangs.
The script runs properly, but the rsh never ends. I tried
closing STDOUT, STDERR and STDIN, to no avail.
Is there a solution to this problem?
Jean-François Bertrand
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Hi,
I wonder what idioms are available to loop through
the lines stored in a scalar variable. I guess I'm
looking for something analogous to these idioms
for files and arrays respectively:
while() {
# do stuff
}
foreach (@array) {
# do stuff
}
When I had to do this I split the scalar in an
arra
* Paul Johnson [2008.01.01 22:10]:
> The most direct analogy would be to use an
> in-memory file:
>
> open my $fh, "<", \$scalar;
> print while <$fh>;
Very nice. Thanks.
I didn't understand what John and Chas were trying
to say until I saw the term "in-memory file".
Exactly the kind of stuff I
-)
So the solution proposed will work fine on Unix, Windows, MacOSX, etc.
Just FYI.
J-S
_
Jean-Sébastien Guay
-- Conseiller technique - Administration
-- (514) 522-9800 #4840
-- [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
, it's irrelevant, it works, so let's just use it, regardless of
who's to blame (err, thank).
J-S
_
Jean-Sébastien Guay
-- Conseiller technique - Administration
-- (514) 522-9800 #4840
-- [EMAIL PROTECTED]
--
To unsubscribe,
1 - 100 of 127 matches
Mail list logo