Hello to all,
Does anyone know the solution ?
Two strings A and B are present. I want to check whether B is a Substring of A.
1. The value of A is - 29 * * * /bin/ls "test" "tmp*" "log*"
(Note: Pl note that A contains DOUBLEQUOTES, ASTERISK & FRONTSLASH)
2. The value of B is -... (5 Replies)
How can I use Perl to a take a string of 10 characters and print the last five characters of the string in columns 1-5 and the first five in columns 6-10?
Result:
0123456789
5 0
6 1
7 2
8 3
9 4 (5 Replies)
Hi Scripting Gurus, I am new bee in perl, and trying to write a script which must print the free disk space availability of C and E drives. Please advice.
Here is the script snippet and expected output:
#!/usr/bin/perl
use CGI qw/:html3 :standard/;
$spaceuselog =... (4 Replies)
Hi All,
I have the following sql query
select abcd from udbadm.log where xyz='1'.
I have 16k queries similar to this with different values for xyz.
I want to print the values of 'abcd' for each row.
I have the following perl code, but not sure how i can print that particular... (1 Reply)
My script below is supposed to log in to my vB account on any vB forum I'm registered on and retrieve + print my security token. However it seems to be hit and miss. The logging in works perfectly just will not retrieve and print the security token for every forum I log in to. Code Below:
... (3 Replies)
Hi,
I have a file with lines like this.
2 7 18 ggcgt anna
2 7 18 hhchc sam
3 7 18 hhdjcc ross
4 7 18 hhcjd jenny
0 8 21 jjdhs sam
3 8 21 kkok bush
2 9 24 kosss BrenhamIf the values of the second column are equal, print only those lines with the least first column value. So in... (5 Replies)
Hey guys i am using perl and trying to pull a list of books from a database and then populate the list in a separate TT2 file. When the list is generated there should be 39 book names. When I do the foreach statement in my tt2 below, the first statement gives me 39 Array(random number) and the... (1 Reply)
I got multiple of documents in which i have to extract a line coming after a ID..The scenario is
Customer ID: none
VT : 002/89
Customer ID: Yes
VT: 001/89
Customer ID: none
VT: 006/85
Customer ID: Yes
VT: 003/56
I have to extract the id which is coming after YES..The output... (7 Replies)
Hello friends,
i have a perl script as below ...
for (0 ..$#values)
{
##want to print some message here in Report.txt file
print `find /abc/xyz/pqr/$values" -type f -ls` >> Report.txt
}
I am able to get output of print `find /abc/xyz/pqr/$values" -type f -ls` >> Report.txt
in... (2 Replies)
Discussion started by: harpal singh
2 Replies
LEARN ABOUT SUSE
pdl::pod::usage
Usage(3) User Contributed Perl Documentation Usage(3)NAME
pod2usage - print a usage message using a script's embedded pod documentation
SYNOPSIS
use PDL::Pod::Usage;
pod2usage();
pod2usage(2);
pod2usage({EXIT => 2});
pod2usage({EXIT => 2, VERBOSE => 0});
pod2usage(EXIT => 1, VERBOSE => 2, OUTPUT=*STDERR);
pod2usage(VERBOSE => 2);
DESCRIPTION
pod2usage will print a usage message for the invoking script (using its embedded pod documentation) and then exit the script with the
specified exit value. It takes a single argument which is either a numeric value corresponding to the desired exit status (which defaults
to 2), or a reference to a hash. If more than one argument is given then the entire argument list is assumed to be a hash. If a hash is
supplied it should contain elements with one or more of the following keys:
"EXIT"
The desired exit status to pass to the exit() function.
"VERBOSE"
The desired level of "verboseness" to use when printing the usage message. If the corresponding value is 0, then only the "SYNOPSIS"
section of the pod documentation is printed. If the corresponding value is 1, then the "SYNOPSIS" section, along with any section
entitled "OPTIONS", "ARGUMENTS", or "OPTIONS AND ARGUMENTS" is printed. If the corresponding value is 2 or more then the entire
manpage is printed.
"OUTPUT"
A reference to a filehandle, or the pathname of a file to which the usage message should be written. The default is "*STDERR" unless
the exit value is less than 2 (in which case the default is "*STDOUT").
"INPUT"
A reference to a filehandle, or the pathname of a file from which the invoking script's pod documentation should be read. It defaults
to the file indicated by $0 ($PROGRAM_NAME for "use English;" users).
If neither the exit value nor the verbose level is specified, then the default is to use an exit value of 2 with a verbose level of 0.
If an exit value is specified but the verbose level is not, then the verbose level will default to 1 if the exit value is less than 2 and
will default to 0 otherwise.
If a verbose level is specified but an exit value is not, then the exit value will default to 2 if the verbose level is 0 and will default
to 1 otherwise.
EXAMPLE
Most scripts should print some type of usage message to STDERR when a command line syntax error is detected. They should also provide an
option (usually "-h" or "-help") to print a (possibly more verbose) usage message to STDOUT. Some scripts may even wish to go so far as to
provide a means of printing their complete documentation to STDOUT (perhaps by allowing a "-man" option). The following example uses
pod2usage in combination with Getopt::Long to do all of these things:
use PDL::Pod::Usage;
use Getopt::Long;
GetOptions("help", "man") || pod2usage(2);
pod2usage(1) if ($opt_help);
pod2usage(VERBOSE => 2) if ($opt_man);
CAVEATS
By default, pod2usage() will use $0 as the path to the pod input file. Unfortunately, not all systems on which Perl runs will set $0
properly (although if $0 isn't found, pod2usage() will search $ENV{PATH}). If this is the case for your system, you may need to explicitly
specify the path to the pod docs for the invoking script using something similar to the following:
o "pod2usage(EXIT => 2, INPUT => "/path/to/your/pod/docs");"
AUTHOR
Brad Appleton <Brad_Appleton-GBDA001@email.mot.com>
Based on code for Pod::Text::pod2text() written by Tom Christiansen <tchrist@mox.perl.com>
perl v5.12.1 2009-10-17 Usage(3)