I am trying to change this :
Albert Einstein 52
Peter Scott 22
Hilary Smith 48
Joan Bakewell 30
Catherine Maguire 26
into
Albert Einstein Pass
Peter Scott Fail
Hilary Smith Pass
Joan Bakewell Fail
Catherine Maguire Fail
I have to use a if statement that says:
if field 3 is... (2 Replies)
I had different problem scenarios with IF statement. Can any expert please enlighten me on the difference with these scenarios. Thank you.
1st Scenario:
testdate=`date +%Y%m`
test=`cat /var/log/database0.$testdate*.log | grep "Errors found during processing" | tail -10`
if
then
... (4 Replies)
This is for a program I have to do to calculate the day of the week.
I need to write an if statement that will do the following:
if day is 29 and year is odd, don't calculate dayif ( day == 29 && year == ??? )I know how to do it for the day but I don't know how to do it for the year. (4 Replies)
I am kind of new in Unix and i have to make a menu. I want to put an if statement in the menu. you should enter the filename and it goes to that file. How do i do this? (1 Reply)
I am writing a script that does a search for a argument in a file and lists all like occurrences. The script verifies that it is a file and then runs another script that list the lines. My problem is that I need the script to accept a file or a directory and then go to that directory check all... (1 Reply)
Hi
I am very new to Unix programming and shell scripting. I am trying t figure out how to write a little script that will output the number of directories. I can find the number of directories using ls -l | grep "^d" | wc -l I can not figure out how to do it so when I type the name... (8 Replies)
Hi guys,
Two problems I need solving please. I created a script where the user types in 7 numbers as standard input and each one is then stored in an array. Now I need to perform the following calculations on those numbers:
1) Use a while loop to determine the largest number in the range.
... (2 Replies)
1. The problem statement, all variables and given/known data:
Two problems I need solving please. I created a script where the user types in 7 numbers as standard input and each one is then stored in an array. Now I need to perform the following calculations on those numbers:
1) Use a while... (11 Replies)
I came across a bash script that outputs the forecast for the day and the max temperature but at the end of the day the max temperature disappears ($6) and I am left with "°C" after the forecast.
Here is the script:
#! /bin/bash
curl -s --connect-timeout 30... (7 Replies)
Discussion started by: _light_
7 Replies
LEARN ABOUT CENTOS
ppi::statement::include
PPI::Statement::Include(3) User Contributed Perl Documentation PPI::Statement::Include(3)NAME
PPI::Statement::Include - Statements that include other code
SYNOPSIS
# The following are all includes
use 5.006;
use strict;
use My::Module;
use constant FOO => 'Foo';
require Foo::Bar;
require "Foo/Bar.pm";
require $foo if 1;
no strict 'refs';
INHERITANCE
PPI::Statement::Include
isa PPI::Statement
isa PPI::Node
isa PPI::Element
DESCRIPTION
Despite its name, the "PPI::Statement::Include" class covers a number of different types of statement that cover all statements starting
with "use", "no" and "require".
But basically, they cover three situations.
Firstly, a dependency on a particular version of perl (for which the "version" method returns true), a pragma (for which the "pragma"
method returns true, or the loading (and unloading via no) of modules.
METHODS
"PPI::Statement::Include" has a number of methods in addition to the standard PPI::Statement, PPI::Node and PPI::Element methods.
type
The "type" method returns the general type of statement ('use', 'no' or 'require').
Returns the type as a string, or "undef" if the type cannot be detected.
module
The "module" method returns the module name specified in any include statement. This "includes" pragma names, because pragma are
implemented as modules. (And lets face it, the definition of a pragma can be fuzzy at the best of times in any case)
This covers all of these...
use strict;
use My::Module;
no strict;
require My::Module;
...but does not cover any of these...
use 5.006;
require 5.005;
require "explicit/file/name.pl";
Returns the module name as a string, or "undef" if the include does not specify a module name.
module_version
The "module_version" method returns the minimum version of the module required by the statement, if there is one.
pragma
The "pragma" method checks for an include statement's use as a pragma, and returns it if so.
Or at least, it claims to. In practice it's a lot harder to say exactly what is or isn't a pragma, because the definition is fuzzy.
The "intent" of a pragma is to modify the way in which the parser works. This is done though the use of modules that do various types of
internals magic.
For now, PPI assumes that any "module name" that is only a set of lowercase letters (and perhaps numbers, like "use utf8;"). This behaviour
is expected to change, most likely to something that knows the specific names of the various "pragmas".
Returns the name of the pragma, or false ('') if the include is not a pragma.
version
The "version" method checks for an include statement that introduces a dependency on the version of "perl" the code is compatible with.
This covers two specific statements.
use 5.006;
require 5.006;
Currently the version is returned as a string, although in future the version may be returned as a version object. If you want a numeric
representation, use "version_literal()". Returns false if the statement is not a version dependency.
version_literal
The "version_literal" method has the same behavior as "version()", but the version is returned as a numeric literal. Returns false if the
statement is not a version dependency.
The "arguments" method gives you the rest of the statement after the the module/pragma and module version, i.e. the stuff that will be used
to construct what gets passed to the module's "import()" subroutine. This does include the comma, etc. operators, but doesn't include non-
significant direct children or any final semicolon.
TO DO
- Write specific unit tests for this package
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2011-02-26 PPI::Statement::Include(3)