The Perl symbolic debugger is invoked with perl -d. h    Prints out a help message. T    Prints a stack trace. s    Single steps. n    Single steps around subroutine call. RETURN key    Repeats last s or n. r    Returns form the current subroutine. c [ LINE ]    Continues (until LINE, or another breakpoint, …

Perl Debugger Read more »

File Test Operators -r -w -x  File is readable/writable/executable by effective uid/gid. next unless -f $file; if(-r “test.pl”) { print “readable\n” } -R -W -X File is readable/writable/executable by real uid/gid. -o -O File is owned by effective/real uid. -e -z File exists/has zero size. -s File exists and has non-zero size. …

Perl File/Dir Operations Read more »

Special Variables The following variables are global and should be localized in subroutines: $_ The default input and pattern-searching space. $. The current input line number of the last filehandle that was read. $/ The input record separator, newline by default. May be multicharacter. $, The output field separator for the print …

PERL Read more »

remove all lines from a file: perl -p -i.bak -e ’s#^\*X-something.*\n$##g’ $filename (remove *X-something.*\n) perl -p -n -i.bak -e ’s/^\*X-pol.*\n$//g’ $filename perl -p -n -i.bak -e ’s/\r\n/\n/’ $filename awk ‘{print $3}’ $filename Regular Expressions .    matches an arbitrary character, but not a newline unless it is a single-line match (see m//s). (…)    …

Perl Search/Replace Read more »

$var    a simple scalar variable. $var[28]    29th element of array @var. $p=\@var    now $p is a reference to array @var. $$p[28]    29th element of array referenced by $p. also, $p->[28]. $var[-1]    last element of array @var. $var[$i][$j]    $jth element of the $ith element of array @var. $var{‘Feb’}   one value from hash (associative …

Perl Variables Read more »

The SQL statements GRANT and REVOKE, respectively allow /disallow access. GRANT {role | privilege_list ON object_name} TO user; ROLE ADMIN: CREATE SCHEMA, CREATE USER, ALTER USER, DROP USER, DROP SCHEMA, GRANT, and REVOKE DBA/DDL: All ADMIN privileges, CREATE TABLE, CREATE ANY TABLE, CREATE VIEW, CREATE ANY VIEW, CREATE INDEX, CREATE ANY INDEX, …

SQLPlus Security/Privileges Read more »

The following commands can be issued in SQL*Plus commands. @ pathname Run an SQL Script (see START) @MyScript.sql parameter1 parameter2 parameter3 In the SQL-Script, refer to the parameters as &1, &2, and &3. @@ pathname Run a nested SQL Script. Execute (or re-execute) commands in the SQL*Plus buffer does not list commands …

SQLPlus Commands Read more »