0
假設,我們有一個bash腳本:的Perl:返回執行給調用者,但隨後再次醒來
#!/bin/bash
perl /home/user/myscript.pl
echo "hello"
myscript.pl:
#!/usr/bin/perl
print "First\n";
#here I want the script to sleep for 5 seconds
#and return the execution back to the caller
#so, "hello" will be printed
#but after 5 seconds the script will wake up from sleep and run the next line
print "Second\n";
我怎麼能這樣?