Need assistance in perl scripting .
Is there a logic that i can implement to check the current year and add to an array . ex Current year is 2014 . If 2014 is not present add this year to array .
Last edited by ajayram_arya; 01-15-2014 at 01:13 PM..
I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
Hi,
Is there any way I can grep an array against another array?
Basically here's what I need to do.
There will be an array containing some fixed texts and I have to check whether some files contain these lines. Reading the same files over and over again for each different pattern doesnt seem... (1 Reply)
Hi All,
I wanted to add 1 year to the system date in my script.
say export start_date=`date +%F`
echo $start_date
o/p of this is 2009-09-02
To this i want to add 1 year.
the output i need here is 2010-09-02
can anybody help me ?
Thanks in advance,
Vinay (4 Replies)
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Hi everyone
I have one question about using array in perl. let say I have several log file in one folder.. example
test1.log
test2.log
test3.log
and the list goes on..
how to make an array for this file? It suppose to detect log file in the current directory and all the log file will... (3 Replies)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
okay so my job is requiring me to learn perl and i have never had any type of programming language... ever.
So i need to take a file that has data (nodes/points) with x, y, and z components.
Example of what the file contains is below:
RANDOM TEXT
RANDOM TEXT
Node # x pos ... (23 Replies)
Discussion started by: dets34
23 Replies
LEARN ABOUT DEBIAN
posix::strptime
POSIX::strptime(3pm) User Contributed Perl Documentation POSIX::strptime(3pm)NAME
POSIX::strptime - Perl extension to the POSIX date parsing strptime(3) function
SYNOPSIS
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime("string", "Format");
DESCRIPTION
Perl interface to strptime(3)FUNCTIONS
strptime
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime(string, format);
The result for any value not extracted is not defined. Some platforms may reliably return "undef", but this is dependent on the
strptime(3) function in the underlying C library.
For example, only the following fields may be relied upon:
my ($min, $hour) = ( POSIX::strptime( "01:23", '%H:%M' ) )[1,2];
my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5];
Furthermore, not all platforms will set the $wday and $yday elements. If these values are required, use "mktime" and "gmtime":
use POSIX qw( mktime );
use POSIX::strptime qw( strptime );
my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5];
my $wday = ( gmtime mktime 0, 0, 0, $mday, $mon, $year )[6];
SEE ALSO strptime(3)AUTHOR
Philippe M. Chiasson <gozer@cpan.org> Kim Scheibel <kim@scheibel.co.uk>
REPOSITORY
http://svn.ectoplasm.org/projects/perl/POSIX-strptime/trunk/
COPYRIGHT
Copyright 2005 by Philippe M. Chiasson <gozer@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2010-07-16 POSIX::strptime(3pm)