If you want to get more familiar with perl, in any case it is recommendable to study the man pages (which in case of perl are very instructive), the most basic ones are:
perlrun, perlsyn, perldata, perlop, perlfunc (second level: perlsub, perlre, perlvar)
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format.
rmjoe123@hotmail.com has '@' sign and followed by a '.'
to be more... (1 Reply)
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format.
rmjoe123@hotmail.com has '@' sign and followed by a '.'
to be more... (1 Reply)
Hi all,
Iam a beginer in shell scripting.
i need a script that can parse the arguments and store them in variables.
ex: ./myScript -v v1 -h v2 -c v3......
can someone suggest me...?
tnx in adv. (1 Reply)
Hi,
I have to check whether an argument say $ARGV is not null in an if operator. Please let me know the operator. It would be great if you write a psuedo code.
Thanks in advance
Ammu (4 Replies)
public class HelloWorld {
public static void main(String args) {
System.out.println("Welcome, master");
}
}
and I compiled using
javac HelloWorld.java
]
Suppose that I execute the following command directly from the shell:
java -XX:OnError="gdb - %p" HelloWorld
Then it works... (8 Replies)
i wanna passing an argument which read in a file or a set of files if the files are given in the command line, otherwise use STDIN if no file argument.
i got something like that, but it is not really working.
so can anyone help me? which one is better to use for and how? Use perl.
Thank you
... (0 Replies)
If i have a script name.pl
I run it like name.pl -v file.txt -t ext2 -u user -j
how can I edit the array @ARGV so when my script calls
$ARGV = -v file.txt
$ARGV = -j (2 Replies)
Hi All,
I want to run a bash script using perl. But they are in the different dir.
#! /usr/bin/perl -w
use strict;
my $root=`pwd`;
chomp($root);
my $cmd=".$root/testdir/ft_623.sh 3 4 5 6 7";
print $cmd;
my @line=`$cmd`;
foreach (@line){
print $_;
}
ft_623.sh (0 Replies)
Hello all, I am relatively new to linux and bash scripting. I have what seems to be a simple question but I'm having trouble finding the answer.
The question is what is the difference between the variables $@ and $*. I've seen them both used in the same context, and I've tried a number of... (4 Replies)
Discussion started by: nicthu
4 Replies
LEARN ABOUT DEBIAN
mousex::nativetraits::str
MouseX::NativeTraits::Str(3pm) User Contributed Perl Documentation MouseX::NativeTraits::Str(3pm)NAME
MouseX::NativeTraits::Str - Helper trait for Str attributes
SYNOPSIS
package MyHomePage;
use Mouse;
has 'text' => (
traits => ['String'],
is => 'rw',
isa => 'Str',
default => q{},
handles => {
add_text => 'append',
replace_text => 'replace',
},
);
my $page = MyHomePage->new();
$page->add_text("foo"); # same as $page->text($page->text . "foo");
DESCRIPTION
This module provides a simple string attribute, to which mutating string operations can be applied more easily (no need to make an lvalue
attribute metaclass or use temporary variables). Additional methods are provided for completion.
PROVIDED METHODS
These methods are implemented in MouseX::NativeTraits::MethodProvider::Str. It is important to note that all those methods do in place
modification of the value stored in the attribute.
inc Increments the value stored in this slot using the magical string autoincrement operator. Note that Perl doesn't provide analogous
behavior in "--", so "dec" is not available.
append($string)
Append a string, like ".=".
prepend($string)
Prepend a string.
replace($pattern, $replacement)
Performs a regexp substitution ("s" in perlop). A code references will be accepted for the replacement, causing the regexp to be
modified with a single "e". "/smxi" can be applied using the "qr" operator.
replace($pattern, $replacement)
Performs a regexp substitution ("s" in perlop) with the "g" flag. A code references will be accepted for the replacement, causing the
regexp to be modified with a single "e". "/smxi" can be applied using the "qr" operator.
match($pattern)
Like "replace" but without the replacement. Provided mostly for completeness.
chop
"chop" in perlfunc
chomp
"chomp" in perlfunc
clear
Sets the string to the empty string (not the value passed to "default").
length
"length" in perlfunc
substr
"substr" in perlfunc. We go to some lengths to match the different functionality based on "substr"'s arity.
METHODS
meta
method_provider_class
helper_type
SEE ALSO
MouseX::NativeTraits
perl v5.14.2 2011-12-04 MouseX::NativeTraits::Str(3pm)