Hi,
Can someone please clarify how we are able to use both IO and GLOB symbols of a package variable interchangeably?
Please consider the following code:
open(FH,"myfile") || die "Unable to open file myfile:$@";
my $glob_var = *main::FH{GLOB};
my $io_var = *main::FH{IO};
print $glob_var... (0 Replies)
Hi friends,,
i have find the matching data between 2files.
My file1 have a data like
rs3001336
rs3984736
rs2840532
File2 have a data like
rs3736330 1 2359237 A G 0.28 1.099 0.010
rs2840532 1 2359977 G A 0.363 0.3373 1.123
rs3001336 1 2365193 G A 0.0812 0.07319 1.12 ... (1 Reply)
Hi friends,,
i have find the matching data between 2files.
My file1 have a data like
rs3001336
rs3984736
rs2840532
File2 have a data like
rs3736330 1 2359237 A G 0.28 1.099 0.010
rs2840532 1 2359977 G A 0.363 0.3373 1.123
rs3001336 1 ... (4 Replies)
I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense.
... (4 Replies)
If you have a look at this thread, you'll see that users have been posting the output a script which are numbers that range from 2 to 5 decimal places. If I dump this entire thread to txt file, how can I:
1) Delete everything except for numbers of the following formats (where 'x' is a digit and... (5 Replies)
Hi
I Have a directory and i have some files below
abc.txt
abc.gif
gtee.txt
ghod.pid
umni.log
unmi.tar
How can use glob function to grep abc files , i have created a variable "text" and i assigned value as "abc", please suggest me how can we use glob.glob( ) to get the output as below... (2 Replies)
Hi
I need some suggestion on glob function.
I am trying to write a python program to grep some specific files in a particular directory.
In the directory i have some files like below
abc.log
abc.pid
abc.tar
gadd.tar
gat.log
gat.tar
in this directory i need to grep onlu my hostname files,... (1 Reply)
I am using Perl version 5.8.4 and trying to understand the use of regular expression. Following is my code and output.
$string = "Perl is a\nScripting language";
($start) = ($string =~ /\A(.*?) /);
@lines = ($string =~ /^(.*?) /gm);
print "First Word (using \\A): $start\n","Line... (4 Replies)
I used this site to check a script.
ShellCheck - shell script analysis tool
Line 57:
zip -u -q Desktop_Items.zip *.desktop
^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
I do not understand what is wrong with my zip... (6 Replies)
Hello All,
I have created a script that searches for different things and "sanitizes" the findings from files. Currently the user is required to put in a hostname (server.serverfarm.abc) one at a time to replace. I would like the user be able to use *.*.abc in grep and then pipe into sed to... (1 Reply)
Discussion started by: jvezinat
1 Replies
LEARN ABOUT CENTOS
tk::choosedirectory
chooseDirectory(3) User Contributed Perl Documentation chooseDirectory(3)NAME
chooseDirectory - pops up a dialog box for the user to select a directory.
SYNOPSIS
$widget->chooseDirectory( ?option value ...? );
DESCRIPTION
The method chooseDirectory is implemented as a perl wrapper on the core tk "command" tk_chooseDirectory, and $widget is passed as the
argument to the hidden -parent option.
The chooseDirectory method pops up a dialog box for the user to select a directory. The following option-value pairs are possible as
command line arguments:
-initialdir dirname
Specifies that the directories in directory should be displayed when the dialog pops up. If this parameter is not specified, then the
directories in the current working directory are displayed. If the parameter specifies a relative path, the return value will convert
the relative path to an absolute path. This option may not always work on the Macintosh. This is not a bug. Rather, the General
Controls control panel on the Mac allows the end user to override the application default directory.
-parent $widget
Makes $widget the logical parent of the dialog. The dialog is displayed on top of its parent window.
-title titleString
Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed.
-mustexist boolean
Specifies whether the user may specify non-existant directories. If this parameter is true, then the user may only select directories
that already exist. The default value is false.
CAVEATS
Perl does not have a concept of encoded filesystems yet. This means that operations on filenames like "opendir" and "open" still use byte
semantics. Tk however uses character semantics internally, which means that you can get filenames with the UTF-8 flag set in functions like
"chooseDirectory", "getOpenFile" and similar. It's the user's responsibility to determine the encoding of the underlying filesystem and
convert the result into bytes, e.g.
use Encode;
...
my $dir = $mw->chooseDirectory;
$dir = encode("windows-1252", $dir);
opendir DIR, $dir or die $!;
...
See also "When Unicode Does Not Happen" in perlunicode and "Unicode in Filenames" in perltodo.
EXAMPLE
my $dir = $mw->chooseDirectory(-initialdir => '~',
-title => 'Choose a directory');
if (!defined $dir) {
warn 'No directory selected';
} else {
warn "Selected $dir";
}
SEE ALSO
Tk::getOpenFile, Tk::getOpenFile
KEYWORDS
directory selection dialog
perl v5.16.3 2014-06-10 chooseDirectory(3)