Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. 133tcamel

    RegEx - Split Update Statement into back references

    not 100% sure but you can try using \s*(\w+)\s* instead of .+ in your statement --- cheers! san print length "The answer to life, universe & everything!
  2. 133tcamel

    The best XML writer module?

    Hi, I'd use XML::Simple to write the same thing back to the file unless i missed something.. this code is copied from a file so you may need to tweak it per your needs #!/usr/bin/perl use strict; use XML::Simple; sub hash2xml { my $info = shift; my $xs = XML::Simple->new(...
  3. 133tcamel

    data binding with curly brackets (mxml)

    Hi, Can someone help me out with this example: Suppose I want to write this code in Flex <mx:Button id="b1" includeInLayout="{b1.visible}"> No what I want to do INSTEAD is instead of "b1" i want to refer to the component inline, like the "this" keyword. So my new (compact) code would be...
  4. 133tcamel

    Cant extract links!!

    yep for that you need to make that into a global array. Append the domains using a pattern match instead of hardcoding it.. so while pushing in the values, if the link doesn't start with a ^http:// then push it like "http://$dom/$link" where $dom holds the value of $1 of your match. HTH ---...
  5. 133tcamel

    Cant extract links!!

    try this use LWP::Simple qw/get $ua/; use HTML::Parser; $ua->agent( "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" ); my $data = get( 'http://google.com/' ); HTML::Parser->new( start_h => [sub { print shift->{href}, "\n" if ( shift eq 'a' ) }, 'tagname, attr'], )->parse( $data ) || die...
  6. 133tcamel

    Perl Direct SMTP Server

    Yes, its pretty easy... it can be done in a very few lines i suppose. The algo for this should be like this: my $mx = Net::DNS ( "MX" Record(s) by weight || "A" Record ); #`dnsmx domain` if you have djbdns my $sock = socket ( $mx, port(25) ); if ( /banner greeting/ ) { Print to $sock, SMTP...
  7. 133tcamel

    Checking for UDP availability

    Not really sure if this fits your problem, but the general rule of the thumb is to use IO::Select or IO::Poll with a timeout and then check the flags for errors, data, etc. Because of the timeout your programs runs (in a loop) regardless of anything. HTH, San --- cheers! san print length...
  8. 133tcamel

    mod_perl and strategies

    Hi, 1) Not all because you can easily mix the normal cgi scripts with your apache handlers. Simplistically speaking you would want the scripts that get hit on 10 times a second in mod_perl (like say a redirection URL on tinyurl.com) and you want your long tedious scripts (like one that sends...
  9. 133tcamel

    CGI creating HTML with form: Default &quot;Values&quot;?

    You can use the Params Hash to do this use CGI qw/:standard -no_debug/; my %FORM = CGI::Vars(); print<<EOF; <BR>First name: <input type="text" name="First" value="$FORM{'first'}"> <BR>Last name: <input type="text" name="Last" value="$FORM{'last'}"> <BR><BR><BR><input type="submit"...
  10. 133tcamel

    How to run a javascript then trigger perl

    Hi, Hoping that you just need to "trigger" the perl script( and not get any response from it), you can use the following javascript. <script> var img = new Image; function allDone() { img.src = "http://domain.com/cgi-bin/perl.cgi?name=san&more=1&rand="+Math.random(); } allDone(); </script>...
  11. 133tcamel

    Hash Value is defined or not null

    you can try using the exists function: if (exists($Hash->{'Value'})) {} "I have tried to use the DEFINED function, but it's not reliable with hashes"... haha :) --- cheers! san print length "The answer to life, universe & everything!
  12. 133tcamel

    Wait for file existence

    if you'd like to sleep for less than a second, try using Time::HiRes. It allows you to sleep in microseconds. There is also something about file triggers (linux), i once browsed in a book which could be a TIMTOWTDI. But I wouldn't go that route unless really neccessary. --- cheers! san print...
  13. 133tcamel

    Using Java and Perl (JPL?)

    Hi, I posted something similar (not about JPL though) a long time back here. You may find it of interest: http://www.tek-tips.com/viewthread.cfm?qid=702166&page=1 --- cheers! san print length "The answer to life, universe & everything!
  14. 133tcamel

    Wait for file existence

    yes, that is correct. which is why i would suggest not using it for a production server. The reason for using sleep inside the while loop is because sleep suspends the process and hence there is no noticable CPU utilization until the next check. --- cheers! san print length "The answer to...
  15. 133tcamel

    Time Comparision

    try using Date::Manip from CPAN. The function you're looking for is most probably DateCalc. --- cheers! san print length "The answer to life, universe & everything!
  16. 133tcamel

    Running other programs from perl using `someprogram`

    It *may* be that the program is writing to stderr, so you can try this: $t1=`linuxprogram 2>&1` alternatively, you can use a pipe to do this, like: open(X, "linuxprogram 2>&1 |"); print while (<X>); close(X); --- cheers! san print length "The answer to life, universe & everything!
  17. 133tcamel

    Wait for file existence

    if it's not production level code, you can do away with this: sleep 1 while ( !(-e "c:/tmp.txx") ); --- cheers! san print length "The answer to life, universe & everything!
  18. 133tcamel

    Using Perl to enable/disable radio buttons

    You can accomplish this using AJAX. Try searching for CGI::Ajax on CPAN. This will get the work done but Ajax will run only with new browser versions, so it depends on how badly you need it and where. --- cheers! san print length "The answer to life, universe & everything!
  19. 133tcamel

    illegal seek when running a perl program from inside a perl program

    are you running summary.pl on the command line or under HTTP, and is it the same user as report.pl? --- cheers! san print length "The answer to life, universe & everything!
  20. 133tcamel

    Sockets and HTTP

    if you're toy around with writing a web server then its a different thing but if this HTTP server is a part of a bigger project then you should try using HTTP::Daemon, a standard perl Module distributed with libwww-perl (LWP). Plus you'll have the same amount of control as writing your own...

Part and Inventory Search

Back
Top