This is just like ReadLine regexp quicktest except it tests a string for substitutions. You can screw it up just as in your own perl code! Again, if you have an instance where this doesn't hold true comment. To be clear:
string: give a string to be substituted from
replace: give a regexp pattern to replace
with: give a string to replace regexp pattern
suffix: something to follow the last "/", eg. smx
And all the while you can shuffle up and down using the ReadLine command history...
this is really not much more (and less) use than plain ol' grep, but i want to use it as the basis for a GUI code scanner/viewer. It is set to check only .pl files, and requires a regexp on the command-line to work. The output (linux) is exactly what my_nihilist describes below.
as I mentioned in Interact with mainframe screen, I am using the OLE interface of IBM Personal Communications 3270 emulator to perform automated tasks on a mainframe. However, some sessions get stuck when 3 or 4 sessions are used in parallel. So I tried to find another way...and I found it. Starting at version 4.1 or 4.3 (don't know exactly), a DLL EHLAPI.dll is provided with PCOMM to interface C or Java applications with the emulator, and I also found Win32::API.
Once everything is put together, I managed to have some interaction between Perl script and the 3270 emulator with the following code.It is a just a simple one, but works, and shows an increase speed execution(and hopefully less buggy).
How many times did you wanted for Module::Install to just install available Debian packages and THEN use CPAN? I did several times. Here is quick diff to Module::Install::AutoInstall which does just that...
This is a very quick way way to check if a regexp will work the way one wants. It uses Term::Readline::Gnu so you get a command history (as in bash), simplifying repetative experiments. If anyone can find a string/regexp which doesn't work properly please comment. I imagine it will best serve beginners like myself in understanding things like, eg. that "7463" contains "\w", or that anything could contain "X*".
Hello, here is a little function (split_file) which split a file into a given number of part. This is quite simple code, but ease the dispatching of a list of reference to be handled by several jobs running in parallel.
Of course, I am not a Perl expert, and any advise on doing it in a fancier or more efficient way is welcome
The function is called with two arguments, the name of the file, and the number of files to create. The countLines subroutine is called to count the number of lines in a file.
Of course, I am quite new to perlmonks, so If you find that this has nothing to do here, just tell me.
The big font I use, makes the script take significantly longer to start up, but is worth it for ease of letter reading.
Given a Tk::Text widget, insert a string at the current insert location which is "active", i.e. when clicked, executes some function. Actually, the behavior of the "link" is defined by the caller in terms of Tk events. Clicking (<ButtonPress>) is merely one such possibility.
Hi, someone in the Chatterbox asked if I knew how to change the text in a gtk2 stock icon button. It wasn't as straight forward as I thought, as setting the label caused the icon to be lost. Muppet( perl/gtk2 maillist guru) showed me this neat sub to do it. If you are into Gtk2, this may come in handy.
This came up for some work being done at $JOB, which then went through a complete re-design, making this code no longer necessary. But I thought it was an interesting variation on an iterator.
It probably isn't novel to have this style of iterator wrap multiple sources and present them as a single stream. What makes this different is that the sources are read from on a rotating basis; in this case it was n DBI statement handles which represented data that was split among n different MySQL hosts due to the sheer size of the dataset. For certain (mostly aesthetic) reasons, they wanted the processing stage to interleave the result-sets rather than process them in sequence.
This is based on the wrapped objects being DBI statement handles, and the desired return-format being the sort of hash-ref structure returned by the fetchrow_hashref() method. You can write the next() as you see fit for your encapsulated objects.
For more on clever Perl-ish iterators, see chapter 4 ("Iterators") of Higher-Order Perl by Mark-Jason Dominus (ISBN 9781558607019).
This code snippet uses URI package to convert relative URLs contained in HTTP::Response objects (generated by LWP::UserAgent or WWW::Mechanize) to absolute URLs. Useful for CGI scripts that act as a proxy between the browser and website.