Sponsored Content
Full Discussion: Translating script to perl
Top Forums Shell Programming and Scripting Translating script to perl Post 302882546 by blackrageous on Tuesday 7th of January 2014 06:37:00 PM
Old 01-07-2014
This isn't just shell script you have submitted so any translator is probably not going to work. This also contains awk script. There have been a number of times in my career where there just isn't an easy way to handle large and many times poorly written scripts. You just have to attempt to understand them in a top down fashion and re-write them. In this case, I always make sure I am not trying to correct something that really isn't broken. What problem will you solve by converting this to perl?
This User Gave Thanks to blackrageous For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

translating device to filesystem in solaris10

Greetings, I have a oracle database server and i keep getting grid control message Metric=Disk Device Busy (%) Metric Value=98.66 Disk Device=ssd430 Severity=Critical Message=Disk Device ssd430 is 98.66% busy. so I am trying to correlate the ssd430 to the filesystem. I understand this... (3 Replies)
Discussion started by: p4cldba
3 Replies

2. Shell Programming and Scripting

Translating/Replacing characters in a file

Hi, i have a given file named hugo.dat. In this file there are several lines that contain characters like } and ~ Now, i need a script that replaces the character } to ü and character ~ to ß Can anyone help for a working ksh script? Kind Regards FranzB (3 Replies)
Discussion started by: FranzB
3 Replies

3. UNIX for Dummies Questions & Answers

Translating the same file

I want to strip off '\032' character from a file using: tr -d '\032' < oldfile > newfile this outputs the contents of oldfile to newfile, but I wanna do that in the same file i.e. remove the \032 character from the old file. I tried: tr -d '\032' < oldfile > oldfile But the... (3 Replies)
Discussion started by: gagan8877
3 Replies

4. UNIX for Dummies Questions & Answers

translating physical/virtual addresses

Hi all, I am new to Linux kernel/user space programming having been an assembly programmer in my previous life. I am now using 2.6.x kernel on an embedded CPU that has a few dedicated hardware blocks (including more CPU running just C-code, i.e., no operating system). There is a single DRAM... (1 Reply)
Discussion started by: agaurav
1 Replies

5. Shell Programming and Scripting

calling a perl script with arguments from a parent perl script

I am trying to run a perl script which needs input arguments from a parent perl script, but doesn't seem to work. Appreciate your help in this regard. From parent.pl $input1=123; $input2=abc; I tried calling it with system("/usr/bin/perl child.pl $input1 $input2"); and `perl... (1 Reply)
Discussion started by: grajp002
1 Replies

6. Shell Programming and Scripting

Please help translating this to shell

Hello Im new here, I just got my first VPS and I really need help converting this .bat to shell script so i can run my program. @echo off @title DiamondMS v117 set CLASSPATH=.;dist\* java -client -Dnet.sf.odinms.wzpath=wz server.Start pause I have no idea what im doing to convert this... (12 Replies)
Discussion started by: valleric
12 Replies

7. Shell Programming and Scripting

Portable way of translating epoch time

echo $(date +%s) | awk '{ print strftime("%c", $2"-"$3"-"$NF"/"$4); }' The above command only seems to work on newer versions of awk or systems with gawk installed. how can i translate the epoch time into a human readable format using a portable method? also, date -d@$epochtime does not... (3 Replies)
Discussion started by: SkySmart
3 Replies

8. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
DBI::PurePerl(3)					User Contributed Perl Documentation					  DBI::PurePerl(3)

NAME
DBI::PurePerl -- a DBI emulation using pure perl (no C/XS compilation required) SYNOPSIS
BEGIN { $ENV{DBI_PUREPERL} = 2 } use DBI; DESCRIPTION
This is a pure perl emulation of the DBI internals. In almost all cases you will be better off using standard DBI since the portions of the standard version written in C make it *much* faster. However, if you are in a situation where it isn't possible to install a compiled version of standard DBI, and you're using pure-perl DBD drivers, then this module allows you to use most common features of DBI without needing any changes in your scripts. EXPERIMENTAL STATUS
DBI::PurePerl is new so please treat it as experimental pending more extensive testing. So far it has passed all tests with DBD::CSV, DBD::AnyData, DBD::XBase, DBD::Sprite, DBD::mysqlPP. Please send bug reports to Jeff Zucker at <jeff@vpservices.com> with a cc to <dbi-dev@perl.org>. USAGE
The usage is the same as for standard DBI with the exception that you need to set the environment variable DBI_PUREPERL if you want to use the PurePerl version. DBI_PUREPERL == 0 (the default) Always use compiled DBI, die if it isn't properly compiled & installed DBI_PUREPERL == 1 Use compiled DBI if it is properly compiled & installed, otherwise use PurePerl DBI_PUREPERL == 2 Always use PurePerl You may set the environment variable in your shell (e.g. with set or setenv or export, etc) or else set it in your script like this: BEGIN { $ENV{DBI_PUREPERL}=2 } before you "use DBI;". INSTALLATION
In most situations simply install DBI (see the DBI pod for details). In the situation in which you can not install DBI itself, you may manually copy DBI.pm and PurePerl.pm into the appropriate directories. For example: cp DBI.pm /usr/jdoe/mylibs/. cp PurePerl.pm /usr/jdoe/mylibs/DBI/. Then add this to the top of scripts: BEGIN { $ENV{DBI_PUREPERL} = 1; # or =2 unshift @INC, '/usr/jdoe/mylibs'; } (Or should we perhaps patch Makefile.PL so that if DBI_PUREPERL is set to 2 prior to make, the normal compile process is skipped and the files are installed automatically?) DIFFERENCES BETWEEN DBI AND DBI
::PurePerl Attributes Boolean attributes still return boolean values but the actual values used may be different, i.e., 0 or undef instead of an empty string. Some handle attributes are either not supported or have very limited functionality: ActiveKids InactiveDestroy AutoInactiveDestroy Kids Taint TaintIn TaintOut (and probably others) Tracing Trace functionality is more limited and the code to handle tracing is only embedded into DBI:PurePerl if the DBI_TRACE environment variable is defined. To enable total tracing you can set the DBI_TRACE environment variable as usual. But to enable individual handle tracing using the trace() method you also need to set the DBI_TRACE environment variable, but set it to 0. Parameter Usage Checking The DBI does some basic parameter count checking on method calls. DBI::PurePerl doesn't. Speed DBI::PurePerl is slower. Although, with some drivers in some contexts this may not be very significant for you. By way of example... the test.pl script in the DBI source distribution has a simple benchmark that just does: my $null_dbh = DBI->connect('dbi:NullP:','',''); my $i = 10_000; $null_dbh->prepare('') while $i--; In other words just prepares a statement, creating and destroying a statement handle, over and over again. Using the real DBI this runs at ~4550 handles per second whereas DBI::PurePerl manages ~2800 per second on the same machine (not too bad really). May not fully support hash() If you want to use type 1 hash, i.e., "hash($string,1)" with DBI::PurePerl, you'll need version 1.56 or higher of Math::BigInt (available on CPAN). Doesn't support preparse() The DBI->preparse() method isn't supported in DBI::PurePerl. Doesn't support DBD::Proxy There's a subtle problem somewhere I've not been able to identify. DBI::ProxyServer seem to work fine with DBI::PurePerl but DBD::Proxy does not work 100% (which is sad because that would be far more useful :) Try re-enabling t/80proxy.t for DBI::PurePerl to see if the problem that remains will affect you're usage. Others can() - doesn't have any special behaviour Please let us know if you find any other differences between DBI and DBI::PurePerl. AUTHORS
Tim Bunce and Jeff Zucker. Tim provided the direction and basis for the code. The original idea for the module and most of the brute force porting from C to Perl was by Jeff. Tim then reworked some core parts to boost the performance and accuracy of the emulation. Thanks also to Randal Schwartz and John Tobey for patches. COPYRIGHT
Copyright (c) 2002 Tim Bunce Ireland. See COPYRIGHT section in DBI.pm for usage and distribution rights. perl v5.18.2 2013-11-14 DBI::PurePerl(3)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy