Perl: How to avoid warnings for superfluous values returned?
Hi all,
a question for the Perl knowledgeable:
I have use warnings; enabled.
I use something like:
In the further code I only work with some of the returned variables, as the others I have no need for.
Though the turned on warnings complain about this single usage:
I do not want to turn off warnings, neither do I have any usage for those variables/values. If I imagine I had use strict; turned on, I would even get a compilation error...
I had read many answers about people having this problem, but the most common answer was, that you "have to" use the variables.
I mean, I do not know how to be more explicit with localtime() to avoid returned values I do not need, besides writing it to an array and just use the elements I need, which in my eyes would be a stupid workaround (if it works) and not better than the way the warnings complain about.
Enlighten me please and thanks in forward
Update:
I use now @thetime = localtime(time) and it stopped complaining, when I address the elements I need. Still there is memory used up for the returned values of the function.
The code is worse readable than the 1st example where each variable is assigned.
I do not understand why people explain on their websites, it is a kind of bad habit... Looks more like the limited capability of the warnings to distinguish between a somewhere in the code forgotten variable and a returned value of a function that simply gives back a bunch of values.
Hi all,
I have written a perl code and stored the data into Data structure using Data::Dumper module.
But not sure how to retreive the data from the Data::Dumper.
Eg.
Based on the key value( Here CRYPTO-6-IKMP_MODE_FAILURE I should be able to access the internal hash elements(keys) ... (1 Reply)
hey i am using this code to connect to sql , store the value in variable and then
compare it with another variable after some time by executing the same query
but the desired result is not coming
#!/bin/bash
val=$(sqlplus -s rte/rted2@rel76d2 <<ENDOFSQL
set heading off
set feedback off... (11 Replies)
Hello Gurus,
I need to create a file from a .csv file extracting specific columns only.
File structure is
Column1,Column2,Column3,Column4
abcd,1234,"asdf, tew,123",123456
efgh,234,asdf,654321
My output file should have
abcd,123456
efgh,654321
Can you pls help me with the code.
... (10 Replies)
Hi All,
I am connecting to Oracle DB from UNIX script. Want to capture all dates between start date and end date and store them in file. Once this is done, want to read dates one by one. How to achive this in UNIX and Oracle? Please let me know if you have any idea on the same.
Thanks and... (4 Replies)
Hi Folks
I wanted to do something like this :
Go through all the top_level_dirs inside a particular dir.
Grep a particular string in the files in each of those dirs.
Count the occurence of that string in that file
Keep adding these (wc) values so that I can know the total occurences of that... (1 Reply)
I am trying to find a way to utilise the full potential of my cpu cores and memory on my windows machine.
Now, I am quite familiar with grep, however, running a Unix based OS is not an option right now.
Unfortunately, the 32 bit grep for windows that I am running, I cannot run multiple... (1 Reply)
Hi All,
I can;t seem to print out the array in sequence using the below subroutine.
My first element in the array @lotsuffix is suppose to be $lotsuffix as defined in the subroutine, but when the array variable is being pass on the main program, my first element actually becomes $lotsuffix ! ... (4 Replies)
is /. superfluous? why not just say / ?
I can see a use for . on its own. But /. seems superfluous/redundant.
I'm guessing it must have some good reason, there's a whole website named after it!! (5 Replies)
Somebody can please give a highlight on this. The problem shows only on Linux(Redhat) not any other unix flavors
:confused:
Linux :
$unset m
$m=`find . -newer rman_padev_20051206195000.out -name "*L0.rman" -exec ls -l {} \; | awk '{ s+=$5 } END{printf("%.0f", s)}'`
$echo $m
7425089536... (0 Replies)