I need help with a perl parsing script. I have some error logs on a windows machine that I need to parse from a text file, but I know nothing about perl. I usually run this bash script on my linux box and it does just what I need. How would I do the same thing with perl and port it to my windows... (2 Replies)
Dear friends,
i am writing sh shell script
I have a file containing binary data.
like this.
010101010101010101101010101010100001010101010101001.
i want to read some particular bits and convert it into decimal valuse.
example.
1.first i want to read 5 bits and convert it into... (1 Reply)
Hello everyone. I am new to linux and need help again. I need help converting this bash shell to linux:
for i in `ls -l *.txt`
do
`./cnvidtf.pl $i`
`curl -u login:pswd --disable-espv -T loadfile.seq ftp://11.1.11.1`
`mysql -u login -h 11.1.11.1 -ppswd < lddocs.sql`
done
Thanks! Any help... (6 Replies)
Hi,
typeset -l sgf # all lowercase letters
typeset -u SGF # all uppercase letters
sgf=$1
SGF=$sgf
these lines used in my scripts . It ran fine in ksh but when we convert this to bash it erroring out.
I like to know what the use of typeset ??
Thanks & Regards
kanagaraj (3 Replies)
Hi all,
I have one libxxx.so file ( which I got from a third party ). We use shared library libxxx.sl . Is there any way to convert the .so file to .sl file ?
Thanks in advance
- M (3 Replies)
Good evening, I'm currently working on a BASH script to convert audio between file formats and I've come across a snag. At the beginning of the script, I'm having the system check to see if any files with the .m4a extension exist in the directory, and if so, it runs the script. If there are no... (1 Reply)
Hi there
I'm using this script to convert command line history with Epoch time stamp to human readable. While it works fine with users with /bin/csh shell, it fails to convert for users with /bin/bash shell. Why is this happening? I even changed and added * and after the # but it still didnt... (2 Replies)
Hi,
I am just trying to convert the batch script to bash script and i am stuck at one point where I have the below code
for /f "delims=" %%a in (a.txt) do (
for /f "tokens=1,2,3* delims==" %%i in ("%%a") do (
for /f "tokens=1,2,3* delims= " %%x in ("%%i") do (
if... (4 Replies)
I have a script below and wanted to change the output into three different file format (3 separate script)
#!bin/bash
#input file format postwrf_d01_20131206_0600_f08400.grb2
#postwrf_d01_YYYYMMDD_ZZZZ_f0HHHH.grb2
#zzzz= 0000,0600,1200,1800 (in UTC)
#HHHH=00000,00600,01200,01800 ..ect (in... (1 Reply)
Discussion started by: cumulus_255
1 Replies
LEARN ABOUT DEBIAN
object::declare
Object::Declare(3pm) User Contributed Perl Documentation Object::Declare(3pm)NAME
Object::Declare - Declarative object constructor
SYNOPSIS
use Object::Declare ['MyApp::Column', 'MyApp::Param'];
my %objects = declare {
param foo =>
!is global,
is immutable,
valid_values are qw( more values );
column bar =>
field1 is 'value',
field2 is 'some_other_value',
sub_params are param( is happy ), param ( is sad );
};
print $objects{foo}; # a MyApp::Param object
print $objects{bar}; # a MyApp::Column object
# Assuming that MyApp::Column::new simply blesses into a hash...
print $objects{bar}{sub_params}[0]; # a MyApp::Param object
print $objects{bar}{sub_params}[1]; # a MyApp::Param object
DESCRIPTION
This module exports one function, "declare", for building named objects with a declarative syntax, similar to how Jifty::DBI::Schema
defines its columns.
In list context, "declare" returns a list of name/object pairs in the order of declaration (allowing duplicates), suitable for putting into
a hash. In scalar context, "declare" returns a hash reference.
Using a flexible "import" interface, one can change exported helper functions names (declarator), words to link labels and values together
(copula), and the table of named classes to declare (mapping):
use Object::Declare
declarator => ['declare'], # list of declarators
copula => { # list of words, or a map
is => '', # from copula to label prefixes,
are => '', # or to callback that e.g. turns
has => sub { has => @_ }, # "has X" to "has is X" and
# "X has 1" to "has is [X => 1]"
},
aliases => { # list of label aliases:
more => 'less', # turns "is more" into "is less"
# and "more is 1" into "less is 1"
},
mapping => {
column => 'MyApp::Column', # class name to call ->new to
param => sub { # arbitrary coderef also works
bless(@_, 'MyApp::Param');
},
};
After the declarator block finishes execution, all helper functions are removed from the package. Same-named functions (such as &is and
&are) that existed before the declarator's execution are restored correctly.
NOTES
If you export the declarator to another package via @EXPORT, be sure to export all mapping keys as well. For example, this will work for
the example above:
our @EXPORT = qw( declare column param );
But this will not:
our @EXPORT = qw( declare );
The copula are not turned into functions, so there is no need to export them.
AUTHORS
Audrey Tang <cpan@audreyt.org>
COPYRIGHT
Copyright 2006, 2007 by Audrey Tang <cpan@audreyt.org>.
This software is released under the MIT license cited below.
The "MIT" License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
perl v5.10.0 2007-01-27 Object::Declare(3pm)