On 8 July 2014 19:00, Uday Vernekar wrote:
> when i try to install Path::Tiny it gives me following error
>
> # The following REQUIRED prerequisites were not satisfied:
> #
> # File::Spec version '3.33' is not in required range '3.40'
> #
> t/00-report-prereqs.t . ok
> t/basename.t ..
when i try to install Path::Tiny it gives me following error
# The following REQUIRED prerequisites were not satisfied:
#
# File::Spec version '3.33' is not in required range '3.40'
#
t/00-report-prereqs.t . ok
t/basename.t .. File::Spec version 3.4 required--this
i
I'm not about to write my own version here, just offer some pointers I find
makes life easier for myself, and they may help others too if you're not
bound to "I don't want to use CPAN".
These days, I find it easier and safer to just use
> use Path::Tiny qw(path);
>
> my $infile = path('numbers.tx
On 07/07/2014 10:26 AM, Розанда ЧУП wrote:
Without comments is more clear :)
==
#!/usr/bin/perl -w
use strict;
use 5.010;
open FILE, '<', "numbers.txt" or die "can not open file . $!\n";
open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n";
selec
thanks ! :)
07.07.2014, 17:38, "Shawn H Corey" :
> On Mon, 07 Jul 2014 17:26:05 +0300
> Розанда ЧУП wrote:
>> #!/usr/bin/perl -w
>
> This turns the warnings on for everything, including modules that have
> to violate best practices in order to achieve their function. It is
> better to `use warni
On Mon, 07 Jul 2014 17:26:05 +0300
Розанда ЧУП wrote:
> #!/usr/bin/perl -w
This turns the warnings on for everything, including modules that have
to violate best practices in order to achieve their function. It is
better to `use warnings;` so hey can turn it off where needed and you
don't get wa
Without comments is more clear :)
==
#!/usr/bin/perl -w
use strict;
use 5.010;
open FILE, '<', "numbers.txt" or die "can not open file . $!\n";
open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n";
select FILE1; # set the defualt output stream
chom
#!/usr/bin/perl -w
use strict;
use 5.010;
open FILE, '<', "numbers.txt" or die "can not open file . $!\n"; # recommended
to use open with three argument
open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n";
select FILE1; # set the defualt output stream
chomp (my @lines = );
my (@ln,
Program is working . Thank you all.
Date: Mon, 7 Jul 2014 15:48:48 +0530
Subject: Re: want to write to file in different format
From: mukeshbarn...@gmail.com
To: johndelac...@gmail.com
CC: beginners@perl.org
Very nice John!!!I couldn't think it.Mukesh Kumar
Member of Technical Staff
Ca
Very nice John!!!
I couldn't think it.
*Mukesh Kumar*
*Member of Technical Staff*
*Cadence Design Systems (I) Pvt. Ltd.*
*Mob:- +91-8527749333*
On 7 July 2014 15:26, John Delacour wrote:
>
> On 7 Jul 2014, at 09:18, Sunita Pradhan
> wrote:
>
> > I have a file of contents:
> > ---
>
On 7 Jul 2014, at 09:18, Sunita Pradhan wrote:
> I have a file of contents:
> ---
> 1 6
> 2 7
> 3 8
> 4 9
> 5 10
> --
> I want a file with content:
>
> 1 2 3 4 5
> 6 7 8 9 10
Try this:
#!/usr/local/bin/perl
use strict;
my (@col1, @col2);
while () {
chomp;
my @words = spli
#! /usr/bin/perl
use strict;
use warnings;
my $str1 = "";
my $str2 = "";
my $res;
open(FILE, "numbers.txt") or die "Can't open the file 1 $!\n";
open(FILE1, ">test1.txt") or die "Can't open the file 2 $!\n";
open(FILE2, ">test2.txt") or die "Can't open the file 3 $!\n";
while ()
{
chomp;
if(
Hi Sunita,
Here's one way to do it
[code]
use strict;
use warnings;
open my $fin, '<', 'data.txt' or die "Cannot open file ($!)";
open my $fout1, '>', 'output1.txt' or die "Cannot open file ($!)";
open my $fout2, '>', 'output2.txt' or die "Cannot open file ($!)";
while (<$fin>) {
#Approach 1 us
I have a file of contents:
---
1 6
2 7
3 8
4 9
5 10
--
I want a file with content:
1 2 3 4 5
6 7 8 9 10
I have written a few lines of following code but it does not work as expected :
---
#!/usr/bin/perl
use v5.10;
use strict;
use
On 12 April 2010 16:39, Uri Guttman wrote:
>> "PP" == Philip Potter writes:
>
> PP> On 12 April 2010 11:34, Shlomi Fish wrote:
> >> Hi Uri and Philip (and Abimael),
> >> On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote:
> >>> PP> Where did I say PBP was always right? I just didn't want
> "PP" == Philip Potter writes:
PP> On 12 April 2010 11:34, Shlomi Fish wrote:
>> Hi Uri and Philip (and Abimael),
>> On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote:
>>> PP> Where did I say PBP was always right? I just didn't want to let your
>>> PP> style argument be the onl
On Monday 12 Apr 2010 13:59:31 Philip Potter wrote:
> On 12 April 2010 11:34, Shlomi Fish wrote:
> > Hi Uri and Philip (and Abimael),
> >
> > On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote:
> >> PP> Where did I say PBP was always right? I just didn't want to let
> >> your PP> style argument b
On 12 April 2010 11:34, Shlomi Fish wrote:
> Hi Uri and Philip (and Abimael),
> On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote:
>> PP> Where did I say PBP was always right? I just didn't want to let your
>> PP> style argument be the only one in this thread, since there are
>> clearly PP> peo
Hi Uri and Philip (and Abimael),
On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote:
> > "PP" == Philip Potter writes:
> PP> On 12 April 2010 07:55, Uri Guttman wrote:
> >>> "PP" == Philip Potter writes:
> >> PP> On 12 April 2010 04:31, Uri Guttman wrote:
> >> >>> "AM" == A
> "PP" == Philip Potter writes:
PP> On 12 April 2010 07:55, Uri Guttman wrote:
>>> "PP" == Philip Potter writes:
>>
>> PP> On 12 April 2010 04:31, Uri Guttman wrote:
>> >>> "AM" == Abimael Martinez writes:
>> >>
>> >> AM> print {$tmp} "$div_start";
>> >>
On 12 April 2010 07:55, Uri Guttman wrote:
>> "PP" == Philip Potter writes:
>
> PP> On 12 April 2010 04:31, Uri Guttman wrote:
> >>> "AM" == Abimael Martinez writes:
> >>
> >> AM> print {$tmp} "$div_start";
> >>
> >> no need for the {} around a single scalar handle.
>
> PP> Bu
> "PP" == Philip Potter writes:
PP> On 12 April 2010 04:31, Uri Guttman wrote:
>>> "AM" == Abimael Martinez writes:
>>
>> AM> print {$tmp} "$div_start";
>>
>> no need for the {} around a single scalar handle.
PP> But it *does* comply with Perl Best Practices #136.
On 12 April 2010 04:31, Uri Guttman wrote:
>> "AM" == Abimael Martinez writes:
>
> AM> print {$tmp} "$div_start";
>
> no need for the {} around a single scalar handle.
But it *does* comply with Perl Best Practices #136.
* It makes the filehandle obviously different from the other argumen
Abimael Martinez wrote:
Hi,
Hello,
I am having some problems making this little script work, it is supposed
glob files from current dir, and add stuff at the top and bottom of such
files. I am also unshure how the "autoflush" works.
use strict;
use IO::File;
use IO::Handle qw( );
my @
> "AM" == Abimael Martinez writes:
AM> Hi,
AM> I am having some problems making this little script work, it is supposed
AM> glob files from current dir, and add stuff at the top and bottom of such
AM> files. I am also unshure how the "autoflush" works.
AM> use strict;
AM> u
Hi,
I am having some problems making this little script work, it is supposed
glob files from current dir, and add stuff at the top and bottom of such
files. I am also unshure how the "autoflush" works.
use strict;
use IO::File;
use IO::Handle qw( );
my @web_docs = <*.html>;
my @excluded =
Gregory Machin wrote:
Hi
Hello,
I have a script that i'm working on, I want it to write info to a log
file, but I can't get it to write to the file.. I run the script as
root, and I also chmod 0777 the file but still no out put ...
what have it missed ..
___script___
#!/usr/bin/perl
print
On 7/20/07, Gregory Machin <[EMAIL PROTECTED]> wrote:
Ok thanks, for the advise, 2 questions - what did i do wrong in my
original code, cause it's based on a working example, and is IO::File
included in the default perl package ? is this script has to go on an
embedded device with as min dependen
Ok thanks, for the advise, 2 questions - what did i do wrong in my
original code, cause it's based on a working example, and is IO::File
included in the default perl package ? is this script has to go on an
embedded device with as min dependencies as possible ?
Many Thanks
On 7/20/07, Chas Owe
On 7/20/07, Gregory Machin <[EMAIL PROTECTED]> wrote:
Hi
I have a script that i'm working on, I want it to write info to a log
file, but I can't get it to write to the file.. I run the script as
root, and I also chmod 0777 the file but still no out put ...
what have it missed ..
snip
Simplify,
Hi
I have a script that i'm working on, I want it to write info to a log
file, but I can't get it to write to the file.. I run the script as
root, and I also chmod 0777 the file but still no out put ...
what have it missed ..
___script___
#!/usr/bin/perl
print "hello";
use
use strict;
#p
Thanks a lot...
It's my fault, a big mistake
Sorry, my $sta[0] is empty
Because of the variables passed by html link.
but when print to screen, I pass the right parameters.
so awful
Thanks again.
Sorry.
Best Regards,
xu
On 7 5 , 6 43 , [EMAIL PROTECTED] (Tom Phoenix) w
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:
> What trouble? Are you saying that $kml printed to a file is
> different than $kml rendered in a web browser, or what?
yes, they are different. I don't know how to describe it..
Try this just before you print the variable, to the screen or t
please...
this forum refresh so slowly
On 7 5 , 1 06 , [EMAIL PROTECTED] (Tom Phoenix) wrote:
> On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:
>
> > for (my $i=0;$i<=$#data;$i++)
> > { $kml.="0station".
> > $sta[$i]."";}
>
> That _might_ be correct. But why does the loop count th
> At this point, if I use following script, I can work as I wish:
> print "Content-type: text/html\n\n";
> print $kml;
1station38a href=http://globec.whoi.edu>U.S.GLOBEC
http://mapservice-xu.whoi.edu/globec.gif";>
http://mapservice-xu.whoi.edu/maps-bin/globec-xu/map4>GEORGES
BANK MAPSERVER
http
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:
for (my $i=0;$i<=$#data;$i++)
{ $kml.="0station".
$sta[$i]."";}
That _might_ be correct. But why does the loop count through the last
element of the @data array, when you're processing the @sta array? And
did you ever initialize $kml?
, the trouble is coming...
What happened?
BR,
xu
> herostar1981 <[EMAIL PROTECTED]> asked:
>
> > I have a big question.
> > why are the contents different between what I write to file
> > and what print in screen?
>
> Obviously you are doing somethin
rote:
>
> > why are the contents different between what I write to file and what
> > print in screen?
>
> Because of something in your source code.
>
> Cheers!
>
> --Tom Phoenix
> Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
TED]> wrote:
>
> > why are the contents different between what I write to file and what
> > print in screen?
>
> Because of something in your source code.
>
> Cheers!
>
> --Tom Phoenix
> Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
On 7/5/07, herostar1981 <[EMAIL PROTECTED]> wrote:
why are the contents different between what I write to file and what
print in screen?
Because of something in your source code.
Cheers!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addi
herostar1981 <[EMAIL PROTECTED]> asked:
> I have a big question.
> why are the contents different between what I write to file
> and what print in screen?
Obviously you are doing something wrong ;-)
If you want us to help you, please send a minimal code sample
that de
Hi anybody,
I have a big question.
why are the contents different between what I write to file and what
print in screen?
I write a cgi script. In my opinion, it should write some information
into file which locates /htdocs/tmp.
But I don't know what happened.
It can print in ter
;
print OUTFILE $_;
close OUTFILE;
}
if ($comread) {
$comread = 0;
}else {
sleep 1;
}
}
-Original Message-
From: swayam panda [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 25, 2005 11:08 PM
To: b
Hi All ,
I am using Win32::SerialPort to read the datas from the
serial port .It's working fine .but i want to save (what ever the serial
port is reading) to a log file continuously .Can anybody help me how to do
.I know that i have open a file like
open (*FIL,+>>log.txt) or d
Harry Putnam <[EMAIL PROTECTED]> writes:
> Note that the original example from perldoc IO::Tee
> has no opens in it:
>
> use IO::Tee;
>
>$tee = IO::Tee->new($handle1, $handle2);
>print $tee "foo", "bar";
>my $input = <$tee>;
>
>
Haa, I dug it up o
Harry Putnam <[EMAIL PROTECTED]> writes:
> cat io.pl
> #!/usr/local/bin/perl -w
>
> use IO::Tee;
>
> open($handle1, "file1") or die("No!");
> open($handle2, "echo") or die("No2!");
>
> $tee = IO::Tee->new($handle1, $handle2);
>
> print $tee "Hello world!";
Note that the or
Tor Hildrum <[EMAIL PROTECTED]> writes:
> #!/usr/bin/perl
> use IO::Tee;
>
> open($handle1, "file1") or die("No!");
> open($handle2, "echo") or die("No2!");
>
> $tee = IO::Tee->new($handle1, $handle2);
> print $tee "Hello world!";
Well thats better than what I came up with but it dies here on the
On Sun, 12 Dec 2004 19:32:53 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Yeah, probably something like that but what else needs to be in there
> to make the example work?
Wild guess:
#!/usr/bin/perl
use IO::Tee;
open($handle1, "file1") or die("No!");
open($handle2, "echo") or die("No2
Tor Hildrum <[EMAIL PROTECTED]> writes:
> I have never used this module before in my life, but are you sure
> $handle1 and $handle2 aren't supposed to be refs to actual
> File-Handles?
Yeah, probably something like that but what else needs to be in there
to make the example work?
Running it just
On Sun, 12 Dec 2004 15:33:44 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Trying to see something of how it works:
>
> #!/usr/local/bin/perl -w
> use IO::Tee;
> my ($handle1, $handle2);
> $handle1 = "./one"
> $handle2 = "./two"
> $tee = IO::Tee->new($handle1, $handle2);
I have never use
[EMAIL PROTECTED] writes:
> Scott Dial <[EMAIL PROTECTED]> writes:
>
>> Try:
>> http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
>
>>> ===
>>> Something I've wanted a few times was a way to write to two places at
>>> once or really I mean with one print call.
>>>
>>> Something like:
>>> print
Scott Dial <[EMAIL PROTECTED]> writes:
> Try:
> http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
>> ===
>> Something I've wanted a few times was a way to write to two places at
>> once or really I mean with one print call.
>>
>> Something like:
>> print FILE1 FILE2 "something\n";
>> or
>>
Try:
http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm
-smd
+++ Harry Putnam [12/12/04 14:02 -0600]:
> Duplication alert: I hope this isn't a duplicate but I think something
> strange happened to my first try
>
> ===
> Something I've wanted a few times was a way to write to two places at
> once
Duplication alert: I hope this isn't a duplicate but I think something
strange happened to my first try
===
Something I've wanted a few times was a way to write to two places at
once or really I mean with one print call.
Something like:
print FILE1 FILE2 "something\n";
or
print FILE TTY "some
Ron Goral wrote:
Thanks again for the replies. I contacted my host and the shared
SSL does indeed operate under its own name which is different from
mine. It is possible to create files under such circumstances, but
they must be created in a folder that is 0777. I'm not crazy about
having a fold
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 8:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > If I try to create the file usi
Ron Goral wrote:
If I try to create the file using open(LOG,"+>>$logfile), the error
is:
No such file or directory at
/usr/wwws/htdocs/mydomain/cgi-bin/test.cgi line 35.
You must not include the '+' character when creating a file.
perldoc perlopentut
Try:
open LOG, ">> $logfile" or die $!;
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > chmod 0666 is the right thing.
Ron Goral wrote:
chmod 0666 is the right thing. Thank you. However, I am not able
to do that programmatically when the script is running in secure
mode. The following dies:
$file_path = qq[/usr/wwws/htdocs/mydomain/cgi-bin/logs/errs.log];
chmod 0666,$file_path or die "Cannot chmod $file_path - $!
> -Original Message-
> From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 9:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Write to file with shared server certificate
>
>
> Ron Goral wrote:
> > I need to write to a log file to re
Ron Goral wrote:
I need to write to a log file to record things happening in a cgi
script. The environment is secured using a server-wide, shared
certificate. I cannot write to the file and get an error telling
me I do not have the proper permissions to do so.
So, why don't you change the file per
Greetings -
I need to write to a log file to record things happening in a cgi script.
The environment is secured using a server-wide, shared certificate. I
cannot write to the file and get an error telling me I do not have the
proper permissions to do so. The log file is in my web's directory, b
Sweet thanks!
> On Mon, 10 Feb 2003 12:32:16 -0600, Dan Muey wrote:
>
> > I'm tryin got find the quickest way to creat a file and write to it.
> >
> > I know I can do
> > open
> > print FILEHANDLE $stuff;
> > close...
> > and perhaps ad some flocks for good measure
> >
> > what I'm won
On Mon, 10 Feb 2003 12:32:16 -0600, Dan Muey wrote:
> I'm tryin got find the quickest way to creat a file and write to it.
>
> I know I can do
> open
> print FILEHANDLE $stuff;
> close...
> and perhaps ad some flocks for good measure
>
> what I'm wondering is if there is a one line way to
>
>
> Dan Muey wrote:
>
> > I'm tryin got find the quickest way to creat a file and write to it.
> >
> > I know I can do
> > open
> > print FILEHANDLE $stuff;
> > close...
> > and perhaps ad some flocks for good measure
> >
> > what I'm wondering is if there is a one line way to do it
Dan Muey wrote:
> I'm tryin got find the quickest way to creat a file and write to it.
>
> I know I can do
> open
> print FILEHANDLE $stuff;
> close...
> and perhaps ad some flocks for good measure
>
> what I'm wondering is if there is a one line way to do it
> something like
>
> createf
I'm tryin got find the quickest way to creat a file and write to it.
I know I can do
open
print FILEHANDLE $stuff;
close...
and perhaps ad some flocks for good measure
what I'm wondering is if there is a one line way to do it
something like
createfile("filename.txt",$content);
somethin
open FILEHANDLE, "> output.txt" or die "$!";
print FILEHANDLE "Some text\n";
print FILEHANDLE "Some more text\n";
close FILEHANDLE;
Dylan
-Original Message-
From: Thomas Browner [mailto:[EMAIL PROTECTED]]
Sent: January 17, 2003 10:22 AM
T
How do I use perl to write to a file?
Thomas
open(OUT, "> test.txt") || die;
print OUT "This is a test...\n";
print OUT "More text...\n";
close(OUT);
On Fri, 2003-01-17 at 08:26, [EMAIL PROTECTED] wrote:
> How can I write to a file in perl.
>
> Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P
> How can I write to a file in perl.
perldoc -f open
open(FILEHANDLE, ">$path_to_file") or die $@;
print FILEHANDLE $newfilecontents;
close(FILEHANDLE);
> writes over
>> appends
< reads
open...
@lines_in)file = ;
close...
Dan
>
> Thomas
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED
How can I write to a file in perl.
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
from oracle and write to file
Thanks for the help!! I think it's almost there. This is what my script look
like now:
use strict;
use DBI;
open(TEXTFILE,">output.txt");
my $dbh = DBI->connect( 'dbi:Oracle:db',
'us
day, April 30, 2002 6:20 PM
To: [EMAIL PROTECTED]
Subject: select from oracle and write to file
Hello all,
Solaris, Oracle 8.1.6, Perl 5
How do I write my selected row from Oracle out to a new file? Below is
what
I have so far. I can select the row, but I don't know how to write it to
a
Hi Garrett,
Not shure if this is where you are looking for, but here is some simple info
on how to write data to a file. If it is not sufficient you'll have to wait for
the real ones to wake up :)
$file = "/path/to/file";
open(F, "> $file");
print F "What you want to store in your file, can al
kage name at ./one.pl line 26.
Any input as to why this happens??
-garrett
>From: "Shah, Urmil" <[EMAIL PROTECTED]>
>To: garrett esperum <[EMAIL PROTECTED]>
>Subject: RE: select from oracle and write to file
>Date: Tue, 30 Apr 2002 17:34:24 -0500
>
>
>open(T
Hello all,
Solaris, Oracle 8.1.6, Perl 5
How do I write my selected row from Oracle out to a new file? Below is what
I have so far. I can select the row, but I don't know how to write it to a
new file:
#!/usr/local/bin/perl -w
#
# REMEMBER! Set the environment variable: ORACLE_HOME=/path-to-
77 matches
Mail list logo