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
14 matches
Mail list logo