•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 456,539 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,158 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 829 | Replies: 4
![]() |
•
•
Join Date: Sep 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
Hi all,
I'm beginner in Perl. I need to concatenate three values in the date format like,
But while concatenating, it is performing division on values. I have tried '.',':','-'. But its not working.
Pls suggest me how to proceed.
I'm beginner in Perl. I need to concatenate three values in the date format like,
$fullDate = $ARGV[3] . "/" . $ARGV[4] . "/" . $ARGV[5];
But while concatenating, it is performing division on values. I have tried '.',':','-'. But its not working.
Pls suggest me how to proceed.
--
Thanks,
Padmaja T N.
Thanks,
Padmaja T N.
try
or
$fullDate = join( "/", $ARGV[3], $ARGV[4], $ARGV[5]);
$fullDate = join( "/", $ARGV[3..5] );
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
$fullDate = join( "/", "$ARGV[3]", "$ARGV[4]", "$ARGV[5]");
$fullDate = "$ARGV[3]" . "/" . "$ARGV[4]" . "/" . "$ARGV[5]";
you might want to do
$ARGV[5] += 1900; before hand, though.Edit: And really, you're not trying very hard yourself, if you don't even give something this simple a try.
Edit again: And don't forget to do
$ARGV[4]++; beforehand as well, since month is, of course, zero based (i.e. Janauary is 0 not 1).Edit a third time: Of course, the math opertions are only needed if those values are coming from a localtime() or gmtime() call, rather than from user input, or some other source where the values may already be properly adjusted.
Last edited by masijade : Oct 11th, 2007 at 5:16 am.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- concatenation of two linked lists (C)
- strcat problem.... (C++)
- XSLT weird problem... [urgent] (RSS, Web Services and SOAP)
- problem in concatenation of 2 strings (C)
- New User (C)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP / 2003)
Other Threads in the Perl Forum
- Previous Thread: Problems writing stdout to a file, please help!
- Next Thread: Return values from Perl to asterisk



Linear Mode