I have what I would have thought was a very simple problem but I can' find an elegant solution.
I have a file which has a single value you in it, say 194. All I want my perl script to do is open the file, read the value and assign that value to a variable.
I've done stuff like this with large files where I've written everything to an array like so:
Something like the above seems excessive for just reading a file with a single value in it.
Is there a one liner or similar for this?
Thanks!!!
Last edited by Yogesh Sawant; 04-01-2009 at 02:29 PM..
Reason: added code tags
Need shell script to read two file at same time and print output in single file
Example I have two files 1) file1.txt 2) file2.txt
File1.txt contains
Aaa
Bbb
Ccc
Ddd
Eee
Fff
File2.txt contains
Zzz
Yyy
Xxx (10 Replies)
I need a script to process a huge single line text file:
The sample of the text is:
"forward_inline_item": "Inline", "options_region_Australia": "Australia", "server_event_err_msg": "There was an error attempting to save", "Token": "Yes", "family": "Family","pwd_login_tab": "Enter Your... (1 Reply)
Dear All
I am trying to write one shell which will be running through Cron which contain one SQL query. But I want to draw/fetch the Username password and Instance name (required to loging to the database) from one single file to run that SQL query . Also this file contain details of multiple... (2 Replies)
Hi,
I have a configuration file that contains one word that I want to store as a variable to use later in my perl program.
i.e.
#cat /opt/dti/ssh_user
root
I want to store root as a variable in perl. In bash I would do this as user=$(cat /opt/dti/ssh_user) (1 Reply)
Hello All,
A part of my very basic perl code requires me to read a single value from a text file.
The file output is the following:
Reading image ... done
IMAGEREGION=0x0x0-256x162x256
VOXELDIMENSION=0.9375000000x1.2000000477x0.9375000000
VOXELNUMBER=10527001... (7 Replies)
Hi I want to replace single quote with two single quotes in a perl string.
If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Hi Folks,
It is regarding the perl scripting.
I have an html file(many files) which contains the below line in the body tag.
<body>
<P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P>
</body>
Now I want to read that html file through perl... (3 Replies)
Hello Forum.
I have a file called abc.sed with the following commands;
s/1/one/g
s/2/two/g
...
I also have a second file called abc.dat and would like to substitute all occurrences of "1 with one", "2 with two", etc and create a new file called abc_new.dat
sed -f abc.sed abc.dat >... (10 Replies)
Hi Experts,
I am querying backup status results for multiple databases and getting each and every database result in one csv file. so i need to combine all csv files in one excel file with separate tabs. I am not familiar with perl script so i am using shell script.
Could anyone please... (4 Replies)
Hi,
I have many files but with only 2 names , I want to load the data of that file into database through sqlldr with single control file. how can i do that ?????
Example:
switch_file
switch_file
billing_file
billing_file
now these files should be loaded into same database but different... (1 Reply)
Discussion started by: niti_sharma
1 Replies
LEARN ABOUT REDHAT
extutils::mm_any
ExtUtils::MM_Any(3pm) Perl Programmers Reference Guide ExtUtils::MM_Any(3pm)NAME
ExtUtils::MM_Any - Platform agnostic MM methods
SYNOPSIS
FOR INTERNAL USE ONLY!
package ExtUtils::MM_SomeOS;
# Temporarily, you have to subclass both. Put MM_Any first.
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
@ISA = qw(ExtUtils::MM_Any ExtUtils::Unix);
DESCRIPTION
FOR INTERNAL USE ONLY!
ExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set of modules. It contains methods which are either inherently cross-platform or
are written in a cross-platform manner.
Subclass off of ExtUtils::MM_Any and ExtUtils::MM_Unix. This is a temporary solution.
THIS MAY BE TEMPORARY!
Inherently Cross-Platform Methods
These are methods which are by their nature cross-platform and should always be cross-platform.
File::Spec wrappers DEPRECATED
The following methods are deprecated wrappers around File::Spec functions. They exist from before File::Spec did and in fact are from
which File::Spec sprang.
They are all deprecated. Please use File::Spec directly.
canonpath
catdir
catfile
curdir
file_name_is_absolute
path
rootdir
updir
Thought To Be Cross-Platform Methods
These are methods which are thought to be cross-platform by virtue of having been written in a way to avoid incompatibilities.
test_via_harness
my $command = $mm->test_via_harness($perl, $tests);
Returns a $command line which runs the given set of $tests with Test::Harness and the given $perl.
Used on the t/*.t files.
test_via_script
my $command = $mm->test_via_script($perl, $script);
Returns a $command line which just runs a single test without Test::Harness. No checks are done on the results, they're just printed.
Used for test.pl, since they don't always follow Test::Harness formatting.
AUTHOR
Michael G Schwern <schwern@pobox.com> with code from ExtUtils::MM_Unix and ExtUtils::MM_Win32.
perl v5.8.0 2002-06-01 ExtUtils::MM_Any(3pm)